BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cheenaChuks
Obsidian | Level 7

Hi everyone,

 

I am trying to solve the following question but I am lost as to how to do this. There are two datasets involved but they can be linked by patient id which is present in both datasets. However I am trying to calculate statistics of three variables as described in my code below: Any thoughts or queries. Sorry, I can't post the dataset but I'd appreciate some help.

/*8
Using the SAS datasets demogdemo and visitdemo and PROC MEANS with the CLASS statement, 
compute the mean, median, 25th percentile, 75th percentile, and the number of non-missing
values for the variables CD4, Weight, and Age for each value of civil status including missing. Report the statistics to three decimal places. In the same PROC MEANS,
create a summary dataset with the OUTPUT statement containing the median and mean of CD4,
Weight, and Age. Using _TYPE_, print only the overall (i.e. all civil status categories combined) mean and median from this summary dataset. */ title "Using a CLASS Statement with PROC MEANS"; proc means data=lb.visitdemo n mean median Q1 Q3 maxdec=3; *what about demogdemo?; class civilstatus; var CD4 Weight Age ; run;

1 ACCEPTED SOLUTION
5 REPLIES 5
Flexluthorella
Obsidian | Level 7

Does it matter if you use proc sql or merge if you want to use the proc means by class statement?

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 816 views
  • 0 likes
  • 3 in conversation