Use value label in if command

前端 未结 3 1584
猫巷女王i
猫巷女王i 2021-01-05 08:06

I am working with a set of dta files representing surveys from different years.

Conveniently, each year uses different values for the country

3条回答
  •  别那么骄傲
    2021-01-05 08:34

    To complement @Dimitriy's answer:

    clear all
    set more off
    
    sysuse auto
    keep foreign weight
    
    describe foreign
    label list origin
    
    replace weight = . if foreign == 0
    
    list in 1/15
    list in 1/15, nolabel 
    

    describe displays the value label associated with a variable. label list can show the content of a particular value label.

提交回复
热议问题