BookmarkSubscribeRSS Feed
AgaWS
Fluorite | Level 6

Hi,

 

I want to find out mean food intake of different food groups in my data set and significant difference between the mean food intake between men and women. Therefore, I want to adjust my variable with a covariate, namely with the total energy intake. I already performed the one-sided t-Test to check for significant differences between all food groups per day. Here is the code: 

 

PROC TTEST DATA=diverse;
   VAR &foodgroup;
   CLASS sex;
RUN;

Now I want to adjust for the covriate of total energy intake per day but I can't find the code for it in the proc ttest procedure. Is there another statement to adjust?

 

Aga

3 REPLIES 3
ballardw
Super User

There are so many things that can be meant by "adjust" that you need to be very specific as to what you mean in this case. A working example with actual data or a link to a reference of what you want would be a good idea.

SteveDenham
Jade | Level 19

You are likely going to need to use PROC MIXED or GLIMMIX for this.

 

proc mixed data=have;
class sex subjid;
model &foodgroup = sex tot_energy_intake sex*tot_energy_intake;
random intercept/subject=subjid(sex);
lsmeans sex/diff;
run;

This tests to see if the slope is the same for the two sexes.  If there is no significant difference, you can remove sex*tot_energy_intake.  If there is a significant difference, you should fit:

 

proc mixed data=have;
class sex subjid;
model &foodgroup = sex sex*tot_energy_intake;
random intercept/subject=subjid(sex);
lsmeans sex/diff;
lsmeans sex/@<low value of tot_energy_intake> diff;
lsmeans sex/@<high value of tot_energy_intake> diff;
run;

Check the analysis of covariance chapter in any of the versions of SAS for Mixed Models for more on this approach.

 

SteveDenham

 

 

AgaWS
Fluorite | Level 6
Thank you so much for these informations!!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 909 views
  • 1 like
  • 3 in conversation