I am currently running a DID analysis to examine the effects of policy interventions.
I have a few questions about the control variables.
The current data format (example) is as follows.
I know that the time-invariant control variables (sex, age) have the same value at both time points, but how should I handle the time-varying variables (income, work) in the DID regression?
pid | sex | age | income | work |
1 | 1 | 50 | 200 | 1 |
1 | 1 | 50 | 300 | 1 |
2 | 0 | 30 | 500 | 1 |
2 | 0 | 30 | 400 | 0 |
3 | 0 | 20 | 600 | 0 |
3 | 0 | 20 | 900 | 1 |
4 | 1 | 40 | 800 | 0 |
4 | 1 | 40 | 400 | 0 |
1. Can I put the INCOME and WORK variables into the model together like the command below? If that's true, what is the interpretation of the results?
PROC MIXED DATA = LONG;
CLASS POST POLICY SEX AGE;
MODEL DEPENDENT=POST|POLICY SEX AGE INCOME WORK / SOLUTION;
LSMEANS POST|EXPOSED / DIFF;
ESTIMATE 'D-I-D' EXPOSED*POST 1 -1 -1 1;
RANDOM Int/SUBJECT=PID TYPE=UN ;
RUN;
2. How would I write the command if I want to control for changes in the control variable (incom, work) over time?
You could use AT to control variables whether it is category or continuous.
Here is some example:
24447 - Examples of writing CONTRAST and ESTIMATE statements (sas.com)
Sure. Also @SteveDenham could you an answer .
You could use AT to control variables whether it is category or continuous.
Here is some example:
24447 - Examples of writing CONTRAST and ESTIMATE statements (sas.com)
Sure. Also @SteveDenham could you an answer .
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.