Hi All,
This question will probably seem simply inefficient, but it's necessary for an analysis I'm doing. I had to reshape data from long to wide based on an individual's ID code. But now I have over a thousand variables, when really I need only need ten indicator variables for an individual's status.
My question is, is there a way to loop through these variables and create an indicator variable? The data looks like this:
And so forth, for over 1,000 of those application status variables. I want Stata to look through each AppStatus variable and pick up on any observations of "1" and generate a new indicator variable for any observations of "1" in any AppStatus variable (and so forth for values 2-10). Is there any way to do this?
Thank you (from a beginner!)
This question will probably seem simply inefficient, but it's necessary for an analysis I'm doing. I had to reshape data from long to wide based on an individual's ID code. But now I have over a thousand variables, when really I need only need ten indicator variables for an individual's status.
My question is, is there a way to loop through these variables and create an indicator variable? The data looks like this:
ID | AppStatus1 | AppStatus2 | AppStatus3 | AppStatus4 |
ID | 1 | 3 | ||
ID | 2 | 5 | ||
ID | 1 | 2 |
Thank you (from a beginner!)
Comment