BookmarkSubscribeRSS Feed
Somia
Calcite | Level 5
The values of hemoglobin for sex "males and females" for three treatment insulin, tablets and insulin were measured. In the data set the 0=male and 1= female, 1= insulin, 2=tablets, 3= diet. I want to compare the mean of hemoglobin for each of the treatment groups and restricting the analysis to men only (e.g to include if sex=0). My question where to include sex=0 to analysis only the men?

Proc format;
Value sexf 0='male'
1='female'

value treatf 1='c insulin'
2='b tablet'
3=' a diet'
run;
data diabet;
infile ' -----------------'
input age sex treat haem;
attrib sex format=sexf. treat format=treatf.;
run;
proc means
class treat;
var haem;
run;
1 REPLY 1

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 1245 views
  • 0 likes
  • 2 in conversation