Hey guys.
I'm actually a little depressed that I can't figure this one out myself - mostly because it, instinctly, seems easy.
Lets say I want to create a data set from scratch. I have a variable, var1, and I want it to be a dummy variable with a specific amount of each. Let's say I want var1 to be 19382 observations = 0 and 3827746 observations = 1. I don't care where each observation go as long as they're all there. I get that I need to go:
set obs 3827746
and then, when I go:
gen dummy = 0
But what is the right command? How to I make 19382 of the 3827746 = 0 and the rest = 1?
I'm actually a little depressed that I can't figure this one out myself - mostly because it, instinctly, seems easy.
Lets say I want to create a data set from scratch. I have a variable, var1, and I want it to be a dummy variable with a specific amount of each. Let's say I want var1 to be 19382 observations = 0 and 3827746 observations = 1. I don't care where each observation go as long as they're all there. I get that I need to go:
set obs 3827746
and then, when I go:
gen dummy = 0
But what is the right command? How to I make 19382 of the 3827746 = 0 and the rest = 1?