My individual-level data includes an outcome variable (svar) with state (FIPS) pooled across years with background characteristics.
I first estimate state adjusted scores with controls using margins command
Next I want to estimate state-specific linear time trend after adjusting for national trend. Is the following code correct, and does the margins command below produce the trend coefficients for each state?
I first estimate state adjusted scores with controls using margins command
Code:
reg svar i.FIPS i.YEAR `cntrls' margins FIPS, post estimates store mar1, title(Adjusted)
Code:
reg svar i.FIPS##c.YEAR `cntrls' margins FIPS, post estimates store mar2, title(Adjusted trends)
Comment