BookmarkSubscribeRSS Feed
Janinka
Calcite | Level 5

I have data for opioid overdose before the pandemic and after pandemic. I have ran my data through regression with dummy variable being month without covid 0 and months with covid 1. 

But I am very new to sas and this week I been reading about interrupted time series using proc autoreg or poison regression. I want to try to run all my data again using the interrupted time series. For my data I am using quarters for the years 2017-2021 labeling them 1-20. Then for my dependent variable I am using number of overdose deaths. For months representing covid 1 and months without covid 0. And lastly pre-and post which pre is 0 and post months are 1,2,3….7.My data looks like this

6100
5200
8300
9400
5511
7612

that is just sample of my data.

first column my = y

second column = months

third column = pre covid and onset covid for the months 

fourth column = onset of covid

 

y=Bo+B1T+B2X+B3TX

 

i tried this code

Data y;
Input y time covid intervention;
Cards;

Proc autoreg data=y
Model y=time covid intervention/ nag=2 method=ml;
Run;

But I think I am doing something wrong because the results are off. Thanks for any help!

 

 

1 REPLY 1

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 281 views
  • 0 likes
  • 2 in conversation