Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Estimating a counterfactual trend holding time varying association constant

    Hi Statalist,

    I'm calculating the following model on repeated cross-sectional survey data over 31 years: 1987-2018. The model looks something like this

    Code:
    reg nbfs i.degree##i.year i.regn2 [pweight=compwt]
    margins degree, at(year = (1987/2018))
    I can then plot the estimated association between degree and nbfs over time.

    What I would like to do is examine the extent to which over time changes in the share of the population educated to degree level will change the over time trajectory of my outcome variable nbfs controlling for changes in the association between degree and nbfs over time (i.e. the interaction effects with year).

    To do so I would like to do a kind of counterfactual simulation. Specifically I would like to set the coefficient of degree on nbfs in all years equal to its' value in the first year, 1987, and then recalculate the over time trajectory of nbfs, thus holding the association between nbfs and degree constant. The idea is that any divergence between over time trajectory of nbfs and the counterfactual trend would be entirely due to over time changes in the share of the sample with a degree rather than changes in the association between nbfs and degree.

    Does anyone have any pointers on how I might implement this calculation? I can't seem to figure it out myself.

    Thanks in advance,

    Dan

  • #2
    Hi Dan,

    It would be helpful to post a sample of the data using dataex.

    Anytway, why don't you simply generate a new variable called degree2

    Code:
    bysort id (year): gen degree2 = degree[1]
    where id is whatever you have as an id variable

    Comment

    Working...
    X