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
6 | 1 | 0 | 0 |
5 | 2 | 0 | 0 |
8 | 3 | 0 | 0 |
9 | 4 | 0 | 0 |
5 | 5 | 1 | 1 |
7 | 6 | 1 | 2 |
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!
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: