Hi statalist community,
How to strip off labels (one values) from numeric variable? Such that string only has numbers (no labels)
How to strip off labels (one values) from numeric variable? Such that string only has numbers (no labels)
label values varlist .
. sysuse auto, clear
(1978 automobile data)
. describe rep78 foreign
Variable Storage Display Value
name type format label Variable label
------------------------------------------------------------------------------------------------
rep78 int %8.0g Repair record 1978
foreign byte %8.0g origin Car origin
. label values rep78 foreign .
. describe rep78 foreign
Variable Storage Display Value
name type format label Variable label
------------------------------------------------------------------------------------------------
rep78 int %8.0g Repair record 1978
foreign byte %8.0g Car origin
.
. sysuse auto, clear
(1978 automobile data)
. describe rep78 foreign
Variable Storage Display Value
name type format label Variable label
------------------------------------------------------------------------------------------------
rep78 int %8.0g Repair record 1978
foreign byte %8.0g origin Car origin
. _strip_labels rep78 foreign
. describe rep78 foreign
Variable Storage Display Value
name type format label Variable label
------------------------------------------------------------------------------------------------
rep78 int %8.0g Repair record 1978
foreign byte %8.0g Car origin
.
Comment