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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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