Some observations in my data set need to be split into two or three differenet observations. For example the following observation:
region income gdp other
North 120 450 50
I need to split it into three observation with the same values for all variables except for the region like this:
region income gdp other
IL 120 450 50
MI 120 450 50
IN 120 450 50
I need something like:
if (region == "North") {
//create three new observations and delete the old one
}
Is it possible with Stata?
region
variable stored before you apply it? If it's in a dataset, just expand all variables and merge the two datasets on row numbers. – Fr.region
variable should be duplicated, and the value "North" must be changed forIL, MI, IN
...I am not sure how I could merge...could you elaborate on it? – CHEBURASHKA_n
. If you provide a data extract somewhere, perhaps it would be easier to show you how this might be able to work. – Fr.