Hi all.
I am currently doing my dissertation based off the same methodology from Goldin and Katz (2002)'s Power of the Pill paper.
I am trying to generate a binary variable P that takes on the value =1 if individual i's state of birth had a nonrestrictive birth control law for minors at the time i was 18 years old and =0 otherwise. I am using the IPUMS 1980 1% Census of Population sample for USA, which includes information on i's state of birth and year of birth. The state of birth has a unique numerical value/ID for each of them but they are not continuous (eg. the number 3 is not assigned to any state).
I also have data for when each state's law changed: In 1969, only 9 states had the nonrestrictive birth control law, thus affecting cohorts born in 1951 (and presumably after?). In 1974, there were 30 states; affecting cohorts born in 1953. By 1974, it was all 50 but 2 states; affecting cohorts born in 1956.
1. My first problem is that I do not know how to create the binary variable for each state of birth and year of birth combination, in order for them to take on the value of =1. I tried doing this for the cohort born in 1951 in the 9 states that had the nonrestrictive laws in 1969:
gen P = 0
replace P = 1 if birthyr == 1951 & bpl == 5 & bpl == 6 & bpl == 13 & bpl == 16 & bpl == 21 & bpl == 28 & bpl == 32 & bpl == 40 & bpl == 49
However, I think there is a more efficient way of generating such a binary variable?
2. Because the state law changes started in 1969, then 1971, then 1974 -- do I just take into consideration the final state laws in 1974 when generating the binary variable?
3. By 1974, all but 2 states have the nonrestrictive birth control law; is there a more precise and efficient way for me to generate the binary variable without doing what I did in question (1)?
Hope I have included enough information and that my questions come across clear.
Related Posts with Problem with generating a binary variable with individual's state and year specifications
how to control for individual fixed effects in Stata?I know one method can be: Code: regress y x1 x2 i.id, vce(robust) But the problem is in my data set…
Propensity Score Matching - Regression on a matched sample and introducing new controlsHi, I am using propensity score matching to reduce selection bias and then running a regression on …
Creating a sum variable which depends on 2 other variablesHello! I am currently working on a panel dataset containing, amongst others, the variables "compani…
Regression based for different time periods based on a conditionDear Stata Users Yesterday I posted a question under the head, "Regression-based on different time p…
Current and Lagged Values of an Independent Variable in xtabond2Hi everyone! May I ask if it is technically correct to include both current and lagged values of an …
Subscribe to:
Post Comments (Atom)
0 Response to Problem with generating a binary variable with individual's state and year specifications
Post a Comment