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

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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