BookmarkSubscribeRSS Feed
dode
Fluorite | Level 6

Hello everyone,

 

How I use t-test in complex survey deign, I read I can do that through surveymeans, but I still don't know how, please help me with the code

Thanks

5 REPLIES 5
ballardw
Super User

Add T to the proc surveymeans statement to request a t-test.

The Ratio statement would be used to indicate which variables to test.

Ratio x y / z t ; where x y z and t are variables will request tests for x with z, x with t, y with z and y with t.

If a variable appears on both sides to the / then the test of a variable with itself is ignored.

dode
Fluorite | Level 6

Hello  ,

Thank you so much for replay, I provided you the code below, I added T, please can you see if i did the code correctly.

 

proc surveymeans data=transform;
var cognitive_impairment /T;
domain education;
cluster raehsamp;
strata raestrat;
weight r7wtresp;
run;

dode
Fluorite | Level 6

proc surveymeans data=transform; T;
var cognitive_impairment ;
domain education;

ratio cognitive_impairment/education;
cluster raehsamp;
strata raestrat;
weight r7wtresp;
run;

 

can you please check if the code is correct

thanks

dode
Fluorite | Level 6

also how I di ANOVA in survey complex design ?

and Wilcoxon?

SAS_Rob
SAS Employee

You can use Proc SURVEYREG to fit an ANOVA to complex survey data.

 

There are no procedures to fit non-parametric models, although I suppose you could apply SURVEYREG to the ranks.  You would have to do a little research to see how this would be different from the SRS-world but it might be a possibility.  I believe this book even discusses it although I don't recall where exactly in the book it is.

 

 

 

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 5 replies
  • 7517 views
  • 0 likes
  • 3 in conversation