Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Time Series- How to get slope and % change in Y-ax...

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

3 weeks ago

Hi all,

I have a time series data with rate of blood cultures per 1000 pts for 34 months (before and after intervention, indicated by Variable "Intervention" - 0=before intervention, 1= after intervention). Month variable is recorded from Jan 2015 through Oct 2017. I want to see if intervention made a difference in rate of blood cultures (i.e. decrease in the blood culture rate). How do I test this to show a significant difference (with p-value)? Also please explain me how to get the % change in Y-axis for the blood culture rates and slope.

I have no clue how to test this in SAS. Any help with is much appreciated. I am attaching the data (excel sheet) below with the variables.

Thank you very much!

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to sms1891

2 weeks ago

Assuming that these monthly data are independent, you can use either PROC GLM to perform a one-way ANOVA or PROC TTEST to perform a t test. The results are equivalent.

```
data Have;
input Intervention Cult_Per_1000pts Time;
datalines;
0 40.33691 1
0 39.72401 2
0 38.94887 3
0 37.35858 4
0 36.58583 5
0 36.81972 6
0 35.34335 7
0 32.54884 8
0 28.9988 9
0 30.66459 10
0 32.36462 11
0 33.03502 12
0 35.60342 13
0 26.70872 14
0 29.83492 15
0 29.66548 16
1 26.24441 17
1 22.24681 18
1 19.59343 19
1 21.7832 20
1 21.06327 21
1 19.05045 22
1 15.48585 23
1 16.79496 24
1 16.57914 25
1 16.95194 26
1 17.04799 27
1 15.95765 28
1 16.1363 29
1 18.44075 30
1 17.60312 31
1 16.881 32
1 13.90606 33
1 16.62039 34
;
proc glm data=Have;
class Intervention;
model Cult_Per_1000pts = Intervention;
lsmeans Intervention / pdiff;
run;
```

proc ttest data=Have;

class Intervention;

var Cult_Per_1000pts;

run;

IMHO, the t test approach is easier and more familiar for most people. The TTEST doc has an example that explains the output. The documentation for PROC GLM has a Getting Started example that discusses ANOVA. and you can Google for other examples.

The test statistic for the ANOVA (F=164.51) is equivalent to the test statistic for the t test (t=12.83) because t^2 = F.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

2 weeks ago - last edited 2 weeks ago

Hi Rick,

Thanks for the response. I tried the proc autoreg. DO you think this is a good option for testing effect of intervention and time on a rate?

Proc autoreg data = TimeSeries;

model Cult_Per_1000pts= time Intervention/ method=ml nlag=13;

run;

Thanks,

Sat