BookmarkSubscribeRSS Feed
Bren
Calcite | Level 5

Does anyone have a procedure in mind for longitudinal analysis of ordinal data from a complex survey? For this particular outcome, I'd use proc ttest with a paired statement for the first two time points and repeated measures ANOVA for 3 or more time points BUT I am using complex survey data and need to use one of the PROCSURVEY... procedures.  

6 REPLIES 6
SAS_Rob
SAS Employee

To do a paired t-test you could simply create a difference variable and then use Proc SURVEYMEANS on that variable

ginak
Quartz | Level 8

Hi @SAS_Rob , could you provide a bit of guidance please? I've been searching all over and am having trouble!

 

Suppose I want to see if a teacher used textbook1 in 2015 and in 2017. I created a difference variable, called t1.

diff_t1 = textbook1_use_2017 - textbook1_use_2015.

 

so t1 is my difference variable. I have my survey weight variable, call it "weights."

 

How can I test this in surveymeans? I found some documentation saying to use the domain statement, but that doesn't apply here.

proc surveymeans data = dataset;
 	weight weighst;
	var diff_t1;
run;

I don't think I can use surveyreg because I'd need to incorporate fixed and random effects if I ran a model. Please advise.

Thanks!

SAS_Rob
SAS Employee

Assuming that the two variables you are taking the difference of are continuous and you don't also have strata and clusters then that code should give you what you want.

Bren
Calcite | Level 5

Thanks @SAS_Rob - Using PROC SURVEYMEANS worked to test differences between groups over time.  But I'm back with a new twist.  How do I test a Time 1 to Time 2 difference in a continuous variable within a group using complex survey data?  How about three or more time points?

SAS_Rob
SAS Employee

If the data are non-normal then what distribution would you use to describe them?  In this case it is likely that you would need to take a modeling approach if you are going to use SAS.  If the distribution comes from an exponential family then you could use a MACRO that is linked below that uses replicate weights in GENMOD.

https://support.sas.com/rnd/app/stat/examples/SurveyPoisson/surveypoisson.htm

 

I don't see why you couldn't use different DIST= LINK= options for other distributions and link functions (you would need to modify the 

MACRO code MODEL statement, but the idea should still hold.

 

Bren
Calcite | Level 5

Any suggestions for normally distributed data? I have a time 1 and time 2 continuous measure (paired) and I am hoping to test if time 2 is different from time 1.  I'd do a paired t test if I wasn't using complex survey data. So far the only thing I've found is PROC SURVEYMEANS with the T option, but I don't know is that is comparing a group mean or if it is the equivalent of a paired t test.  Do you know? To use PROC SURVEYMEANS with the T option, I calculate the difference between time 1 and 2 and the T option compares that difference from no change (Null hypothesis).

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 3513 views
  • 3 likes
  • 3 in conversation