Statistical Procedures

Programming the statistical procedures from SAS
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!!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 3 replies
  • 1498 views
  • 1 like
  • 3 in conversation