Newbie question here.
Usually, I split a large variable creating new dataset for each value of this variable:
Code:
preserve foreach i of num 1/8 { keep if BigVar == `i' save BigVar`i' restore, preserve }
Now, instead of generating a brand new dataset, I would like only to create new variables. How can I do it?
I tried
Code:
foreach i of num 1/8 { if BigVar == `i' gen BigVar`i' }
Can somebody help me with that?
0 Response to How can I create new variables from one or more parts of a large dataset?
Post a Comment