BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
skclHA
Calcite | Level 5

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

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)

Ksharp_0-1706854556887.png

Sure. Also @SteveDenham  could you an answer .

 

 

View solution in original post

3 REPLIES 3
skclHA
Calcite | Level 5
Thank you for the valuable information. However, it's a bit challenging for me. Could you please provide simpler information regarding continuous variables as the dependent variable? I apologize in advance if it's a difficult request.
Ksharp
Super User

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)

Ksharp_0-1706854556887.png

Sure. Also @SteveDenham  could you an answer .

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2107 views
  • 0 likes
  • 2 in conversation