Programming the statistical procedures from SAS

Means tables from ANCOVA in SurveyReg

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Means tables from ANCOVA in SurveyReg

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?


Accepted Solutions
Solution
‎02-09-2012 07:45 AM
Respected Advisor
Posts: 2,655

Means tables from ANCOVA in SurveyReg

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


All Replies
Esteemed Advisor
Posts: 7,050

Means tables from ANCOVA in SurveyReg

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.

Esteemed Advisor
Posts: 7,050

Means tables from ANCOVA in SurveyReg

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

New Contributor
Posts: 3

Means tables from ANCOVA in SurveyReg

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.

Solution
‎02-09-2012 07:45 AM
Respected Advisor
Posts: 2,655

Means tables from ANCOVA in SurveyReg

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

New Contributor
Posts: 3

Means tables from ANCOVA in SurveyReg

This works perfectly! Thanks, Steve!!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 368 views
  • 0 likes
  • 3 in conversation