Dear all,
I have a variable name "village", and wanted to replace the name of village in observations 1, 3, and 5 with "village A" and in 2,4, and 6 with "village B".
How can I use command foreach or forval in stata?
Thanks for your help.
Cheers,
Ris
Related Posts with Replace a value of multiple observations for one variable
multiple random sample from a dataI created a data with 100,000 obs with uniform distribution and also created information for educati…
Stata local macros not displayingHello, I am trying to rescale weights within a single NSFG survey wave to have a mean of 1, however …
Merging two datasets to calculate an amount of days between two datesDear Statalisters, I'd like my data to be confidential so please forgive me if I remain vague durin…
Loop for variable creationHi, Following is snapshot of the data Below is the dataex of what I currently have Code: * Exampl…
How to reshape/convert a household data set in the wide format to long formatHi family, I have a data set that the individual household member's information is presented in the …
Subscribe to:
Post Comments (Atom)
0 Response to Replace a value of multiple observations for one variable
Post a Comment