Friday, April 27, 2012

Easy recode all missing SPSS or SAS into STATA

* Replaces the variable observations which match the argument after the == sign (-9999) with stata missing(.)


foreach v of varlist * {
    capture replace `v'=. if `v'==-9999
}

No comments:

Post a Comment