I just updated to Stata 15 and now a code I consistently use is broken. Have I overlooked something here, or did Stata 15 change loops?
Here is the code:
global xlist e1-e8
foreach var in $xlist {
recode `var' (1/2=1) (3=2) (4/5=3), gen(`var'_net)
However, I get this error message:
variable e1 already defined
r(110)
Previously, it would just create new variables for e1-e8 with "_net" at the end of each variable. Now it won't. Any advice?
Related Posts with Did Stata 15 Change Loops?
Frequency of TransactionHello Statlist, hope everyone is in good condition I've yearly dataset about supplier sale from maj…
Rename country id in a paneldataDear Statalisters. I am working with two different panal datasets which I want to merge. Unfortunat…
Aggregating law dataHi all. I'm using voter data from Anes but have a problem about the data only giving me the state o…
Generating New Variable with several values of one existing variable using "Wildcards"Hello Statalist, I am trying to generate a new variable based on an existing variable. The existing…
Limiting the y-axis on a marginsplot graphI'm creating a marginsplot graph for a probit model estimating predicted probabilities. Some of the …
Subscribe to:
Post Comments (Atom)
0 Response to Did Stata 15 Change Loops?
Post a Comment