I am trying to encode multiple variables and replace remaining strings with a numeric character - however i am getting an error r(100)
. foreach var of varlist company_23 debt_23 pairincome {
2. encode `var', gen(_`var')
3. replace `var'=0 if `var>2500
}
varlist required
r(100);
How can i solve this?
Related Posts with encode foreach error
How to tag outliers?Hi, I would like to create a dummy that's equal to 1 if it's an outlier, and 0 if not. I can use -ex…
Creating unique group ID variableDear all I have a hopefully trivial question that I can't get my head around right now. My data set…
import data from excel to stata-change the structure of the dataHi, I have a data file in excel which includes more than 300 firms. Information for each firm inclu…
Syntax for lincom won't work in Stata 16 but works fine in Stata 15Hello all. I'm a professor at Baldwin Wallace. On Thursday, I tried to run a lab with my class from …
New package predsurv on SSCThanks as always to Kit Baum, a new package predsurv is now available for download from SSC. In Stat…
Subscribe to:
Post Comments (Atom)
0 Response to encode foreach error
Post a Comment