I am a neophyte on Stata, I don't think this question is complicated but in the help command I couldn't find any clue.
So, in my dataset I have this variable called country.
For a certain number of observations country is equal to 56. I need to duplicate those observations and rename the duplicated observations as 58.
I wrote:
Code:
expand 2 if country==56, gen (country1)
Code:
replace country= 58 if country1==1
The problem arises when I apply this logic to a bigger dataset since, this time, Stata instead of giving 1 and 0, It writes "Original observation" and "Duplicated observation", so I can't apply the second line of the command.
It is bizzarre since in the help expand it says that the newvar can contain just 0 and 1.
How can tell Stata to give me 0 and 1 instead of "Original observation" and "Duplicated observation"?
Thank you in advance,
Riccardo
0 Response to Consideration on the Expand command : Rename a duplicated observation
Post a Comment