BookmarkSubscribeRSS Feed
dhunterschenk
Calcite | Level 5

I want to do a paired t-test, but our data does not have pre and post variables. Instead, there is a type vairable where 1=initial screen, 2=rescreen, and 3=post health coaching. So essentially the patient ID will match and the variables I am interested in veggie consumption, fruit consumption, physcial activity in minutes, etc will be different for the participants at their initial and post screen. It would look something like this:

 

Patient ID     Type     Veggie   Fruit

1                      1            1          2

1                      3             3         4

2                      1             1         2

2                      2             2         2

 

We are interested in comparing two things: The participants scores at their post health coaching screens to their scores at initial screens and the participants rescreen scores to their initial screens scores.

 

Is there an easy way to do this?

 

I have only ever done paired t when their is a post and pre variable. 

 

2 REPLIES 2
art297
Opal | Level 21

You need a repeated measure Anova (e.g., PROC GLM). A nice example and description can be found at:

http://www.ats.ucla.edu/stat/sas/library/repeated_ut.htm

 

HTH,

Art, CEO, AnalystFinder.com

 

sjsanalytics
Calcite | Level 5

An additional idea, could be to create a pre and post variable by creating 3 subsets, renaming the variables (Ex. Pre Veg) in those subsets then performing a merge by patient ID for the subsets that you want to compare in your paired ttest.

 

For Ex:

Subset 1 (Initital Scores) would include variable names PatientID, Veggie, Fruit where Type =1

Subset 2 (Rescreen) would include PatientID, Veggie, Fruit where Type =2

Subset 3 (Post health coaching) would include PatientID, Veggie, Fruit where Type = 3

 

Hope this makes sense,

Shavonne

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1359 views
  • 2 likes
  • 3 in conversation