I need to assign a set of names in one particular order to the first 10 observations. I want to follow the same pattern for the remaining observation. I have around 700 observations in the data. Here is a code example for 3 observation set:
Code:
gen xx = _n : gen name = "nick" if xx == 1 replace name = "tina" if xx == 2 replace name = "pam" if xx == 3
Thanks,
Smriti
0 Response to Assigning set of values/names to every 1-10 observation
Post a Comment