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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 470 views
  • 0 likes
  • 2 in conversation