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 .

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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