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
Generalized Diff-in-Diff with different treatment startsHello, I am new to statalist but I used the forum previously to find help which I did. However, I c…
How to show the ENDOG results using OUTREG2 from INSTRUMENTAL REGRESSION?Hello Stata users, Does anybody know the command in OUTREG2 to show the ENDOG command results (i.e.…
Testing for selection biasHello everyone, I was wondering if anyone knows how to test for differences in characteristics for …
How to attribute a numeric value to a string variable through a loopHi all, In my Dataset I have 12241 unique values, every individual is represented by the variable c…
Procedure to estimate effects with repeated binary outcomes after propensity scoreHello. I'm using Stata 15.1. I have a dataset of 88 observations in the treatment group, and need t…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with generating a binary variable with individual's state and year specifications
Post a Comment