BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LindaW
Calcite | Level 5

Using SAS Survey:

How can I get a means table of the data resulting from an ANCOVA in proc surveyreg? I'm trying to find the variable means that result when a regression of two variables is controlled for gender (or age or another variable). I can't seem to build appropriate syntax. Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

Linda,

Have you specified an LSMEANS statement?

From what you have presented, I assume you have something like:

proc surveyreg data=have;

strata sex;

class sex;

model depvar=sex othervar sex*othervar/solution;

weight weight;

run;

Add the LSMEANS statement that looks something like the following, and it should give you marginal means, adjusted for the covariate 'othervar'.  Note that these are predicted marginals for a hypothetical balanced population.

proc surveyreg data=have;

strata sex;

class sex;

model depvar=sex othervar sex*othervar/solution;

weight weight;

lsmeans sex;

run;

There are several options available to the LSMEANS statement that you might want to explore.  Also, I specified a model that had different slopes for each sex in the ANCOVA--you may wish to fit a common slopes model which would not include the interaction term.

Good luck.

Steve Denham

View solution in original post

5 REPLIES 5
art297
Opal | Level 21

I'd think they are provided in one of the ODS tables (see: http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002649072.htm )

Note: Surveyreg is in the second section of the page, under the SAS/Stat procs.

art297
Opal | Level 21

I probably shouldn't have posted a response as I have never used the proc.  However, that said, wouldn't specifying contrasts provide what you want or, if not, proc surveymeans?  Take a look at: http://support.sas.com/rnd/app/papers/survey.pdf

LindaW
Calcite | Level 5

Thank you so much for trying to help me with this. The thing is, I need to tell SAS to provide adjusted means based on the ANCOVA and I can't see how to write that request. If I use the standard surveymeans request, the response is the unadjusted means. I can't understand how to tell SAS to provide adjusted means in SAS Survey.

SteveDenham
Jade | Level 19

Linda,

Have you specified an LSMEANS statement?

From what you have presented, I assume you have something like:

proc surveyreg data=have;

strata sex;

class sex;

model depvar=sex othervar sex*othervar/solution;

weight weight;

run;

Add the LSMEANS statement that looks something like the following, and it should give you marginal means, adjusted for the covariate 'othervar'.  Note that these are predicted marginals for a hypothetical balanced population.

proc surveyreg data=have;

strata sex;

class sex;

model depvar=sex othervar sex*othervar/solution;

weight weight;

lsmeans sex;

run;

There are several options available to the LSMEANS statement that you might want to explore.  Also, I specified a model that had different slopes for each sex in the ANCOVA--you may wish to fit a common slopes model which would not include the interaction term.

Good luck.

Steve Denham

LindaW
Calcite | Level 5

This works perfectly! Thanks, Steve!!

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