- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This works perfectly! Thanks, Steve!!