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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1130 views
  • 0 likes
  • 2 in conversation