- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
I want to get the mean intake of several food groups after adjusting for a continuous covariate, the total energy intake (TEI).
I used proc glm to obtain the lsmeans for different sex as in the code below and the output:
proc glm data=test;
class sex;
model &foodgroup = sex TEI / solution;
lsmeans sex / stderr pdiff diff cov out=adjmeans;
run;
proc print data=adjmeans;
run;
Now I want to get the adjusted mean value for the total population and not for the genders seperatly but I couldn't find the right statement.
I would be grateful for any help
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can use the at option with LSMEANS to specify the value of the covariate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@gcjfernandez can you provide a link to this text that you are showing?
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The link for at option in Lsmeans:
This will estimate LSmeans of categorical variable levels at a known level of covariate(s)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Two possible ways:
1) mean-center TEI and fit the model omitting SEX. The intercept is the estimated overall mean at the mean of TEI.
proc standard data=test m=0; var TEI; run;
proc glm; model &foodgroup = TEI / solution; run;
2) Use an ESTIMATE statement in your original GLM step - specify the mean TEI and appropriate coefficients for the levels of SEX - probably either 0.5 0.5 to represent a balanced population or the actual observed proportions of the sexes in your data. Assuming a balanced population and mean of TEI is 5.3:
estimate 'adj overall mean' intercept 1 sex .5 .5 TEI 5.3;