ilundberg / replication

Replication files for working papers
4 stars 6 forks source link

b_specific_example_1 #4

Closed rebeccajohnson88 closed 3 years ago

rebeccajohnson88 commented 4 years ago

Commit here

Looks good! Only small question/possible change (changed in above commit and it produces nearly identical results but with some small diff in ~4th sig dig of p value is:

Does the filtering out of irrelevant cohorts restriction, then adjusts weights per mgcv doc to divide weight by mean, then does further analytic restriction to remove those missing any of relevant covars

filter(cohort >= (1972 - 25) & cohort <= (2018 - 34)) %>%
  mutate(num_inCohortRange = n(),
         weight = weight / mean(weight)) %>%
  # Note the sample size with missing dropped
  filter(!is.na(college) & !is.na(cohort) & !is.na(father_category) & 
           !is.na(mother_category) & !is.na(Gender) &
           !is.na(weight))

It seems like the weights adjustment might be better to do after all sample restrictions so in updated code just changed order of that step to be after the second-round filters, but not positive that's correct

d <- d_init %>% filter(is_focal_cohort & is_observed_all) %>%
  mutate(weight = weight/mean(weight))
ilundberg commented 3 years ago

Great. I updated my repository to bring in your changes in and then made a few tiny aesthetic changes in this commit.

Then I ran the code and updated BuchmannDiPrete_output.txt and gss_fourPanel.pdf in Overleaf.