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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 209 views
  • 0 likes
  • 2 in conversation