turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- one group pre post data

Topic Options

- Subscribe to 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-14-2017 08:17 PM

I have data where the outcome is a score and there is only 1 group where all participants recieve the intervention. I have pre and post scores and a number of covariates. So this is a paired t-test in itself, but what test should i use if a am looking to control and stratify?

Accepted Solutions

Solution

03-14-2017
08:58 PM

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

Posted in reply to LucyB

03-14-2017 08:47 PM

You could, but it may be worthwhile to model the difference or change rather than pre/post?

It's definitely worth reading up and seeing what's common in this field. If you're testing one a time it could be an ANOVA as well, which GLM will do anyways

proc glm data=data;

class covariate;

model diff = covariate;

run;

All Replies

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

Posted in reply to LucyB

03-14-2017 08:32 PM

Sounds like GLM or proc mixed. Take a look at: http://www2.sas.com/proceedings/sugi25/25/aa/25p020.pdf

Art, CEO, AnalystFinder.com

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

Posted in reply to art297

03-14-2017 08:44 PM

Thanks for the useful document.

I think then this would be a glm since i dont have any random effects. Would my model be as such:

proc glm data=data;

class covariate;

model post = pre covariate;

run;

Solution

03-14-2017
08:58 PM

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

Posted in reply to LucyB

03-14-2017 08:47 PM

You could, but it may be worthwhile to model the difference or change rather than pre/post?

It's definitely worth reading up and seeing what's common in this field. If you're testing one a time it could be an ANOVA as well, which GLM will do anyways

proc glm data=data;

class covariate;

model diff = covariate;

run;

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

Posted in reply to Reeza

03-14-2017 08:50 PM

should we adjust for pre scores in the model?

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

Posted in reply to LucyB

03-14-2017 09:01 PM

sorry i know i have asked this on mutiple occasions on other threads but i feel like i need to account for the variability in the pre scoress somehow.

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

Posted in reply to Reeza

03-14-2017 09:09 PM

proc glm data=data;

class covariate;

model diff = covariate pre*covariate;

run;

Would the interaction term here tell us the difference between covariate having adjusted for pre? If this is even correct.

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

Posted in reply to LucyB

03-14-2017 09:49 PM

I think your original code is right. it is called covariance analysis.

But need SOLUTION option to get that parameter estimates.

```
proc glm data=data;
class covariate;
model post = pre covariate /solution;
run;
```

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

Posted in reply to Ksharp

03-16-2017 01:46 PM

Thank you. What about the model change = pre cov pre*cov? The interaction seems to address the question, as the pre score increases, the change from post-pre decreases and this is more apparent in one of the covariate groups. Will this be appropriate?

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

Posted in reply to LucyB

03-16-2017 08:37 PM

model change = pre cov pre*cov;

would *not* be appropriate.

You could augment the code provided by @Ksharp as

model post = pre cov pre*cov;

The interaction allows the regression of *post* on *pre* to have different slopes for each value of *cov*.

As @Ksharp notes, these models fall under analysis of covariance. You'll want to get up to speed with ANCOVA before you try to make sense of your results; ANCOVA is trickier than it appears on first glance, IMO. See this example in the GLM documentation:

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

03-16-2017 08:56 PM

Thanks for the link!

My post scores are not normal, which is partly why I wanted to model the change outcome instead. Is there a nonparametric version of glm?

Also, the group variable in the link is the drug, and the patients were probably randomized into the drug categories. My group variable is a characteristic of the study sample (whether or not the subject had prior exposure to the task performed). Will this make a difference? Should I consider a repeated model?

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

Posted in reply to LucyB

03-16-2017 11:28 PM

(1) Are you looking at the distribution of the post values all together prior to fitting a model, or are you looking at the distribution of the residuals after fitting the model?

The normality assumption applies to the response variable *y conditional on the predictor variables x*. For ANOVA, this means that *y* is normally distributed within each treatment level; clearly, if you have few replicates *within each treatment level*, your ability to assess the normality assumption is limited or even nonexistent. For regression, this means that *y* is normally distributed *within each level of x*; again, if you don't have lots of replicates within each level of *x*, you will not be able to assess this assumption prior to fitting a model. What are we to do? We look at the distribution of the residuals.

(2) Are *post* and *pre* in your study measuring the same variable?

If *pre* is "whether or not the subject had prior exposure to the task performed", then it sounds like a categorical variable (yes/no), and if so, it is not a continuous covariate as needed for ANCOVA and it should be listed in the CLASS statement.

Is *post *measured on a continuous scale? Is *covariate* measured on a categorical scale (as I would expect given that it is in the CLASS statement)?

I'm beginning to think that you are on the wrong track entirely and that the appropriate model might be something like a two-way factorial ANOVA-like model. But you haven't provided enough information to tell. If you don't provide enough detail about your study design and your variables, you risk getting a correct answer to the wrong question.

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

03-17-2017 01:25 AM - edited 03-17-2017 01:27 AM

Thanks for the thorough response!

My outcome is continuous (a score); scores are measured pre intervention and post intervention on the same group of patients (n=44). I have no control group. Since a lot of patients did significantly better post intervention, the post distribution is skewed to the left. I used a paired t-test for the analysis of significant improvement (improvement post-pre was normally distributed). I have a variable in my dataset that is binary (yes/no) regarding previous exposure of the patients to the intervention, so I am further interested in seeing if there is differences in this significant improvement level based on levels of this prior exposure. I am really confused on which model above to use to go about this and appreciate your help greatly.

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

Posted in reply to LucyB

03-17-2017 12:20 PM

That's helpful, thanks. ANCOVA might not be a bad approach after all.

When I'm embarking on an ANCOVA, the first thing I do is plot data.

Let post be the post-intervention score, pre be the pre-intervention score, and exposure be the binary "whether prior exposure" variable.

Plot post versus pre, distinguishing by exposure, and add a reference line that depicts pre=post:

proc sgplot data=have; scatter x=pre y=post / group=exposure; lineparm x=0 y=0 slope=1; run;

Things to look for:

(1) Are the two exposure scatters sitting on top of each other (implying no effect of exposure), or are they shifted in some way? Up or down, left or right.

(2) Are the relationships between post and pre for each exposure group linear? (In its basic form, ANCOVA assumes linearity, as well as normality and homgeneity of variance.)

(3) Are the relationships between post and pre for each exposure group parallel to the reference line? If so, then the difference between post and pre does not depend upon the value of pre--the difference is constant. In this case, you could use the model that @Reeza suggested

proc glm data=have; class exposure; model diff = exposure; run;

where diff = (post - pre). Essentially, this is your paired t-test with exposure added.

(4) If one or both relationships are not parallet to the reference line, then the difference between post and pre depends upon the value of pre, and an analysis of the response diff = (post - pre) would be a non-optimal choice. Perhaps, for example, the difference increases as pre increases. ANCOVA is useful in this scenario.

proc glm data=have; class exposure; model post = pre exposure; run;

(5) If the two relationships are not parallel to each other--if the slopes of the two linear regressions are not equal--then add interaction to the model.

proc glm data=have; class exposure; model post = pre exposure pre*exposure; run;

Chapter 7 in this text deals with ANCOVA and would probably be useful

Note that the covariate (here, pre) is centered in the mathematical model: the mean of X is subtracted from each value of X.

Another resource here:

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

03-20-2017 12:30 AM

Very very helpful, thank you so much