Question: d. Using the combined data set from part c), calculate the median baseline cholesterol measurement across all subjects, and use this information to make a
d. Using the combined data set from part c), calculate the median baseline cholesterol measurement across all subjects, and use this information to make a variable that groups subjects as less than or equal to the median, or more than the median without typing the calculated median value by hand into your code.
So using SAS here is a code I have tried:
proc means data= Combo_nodup noprint median; var B_Cholesterol; output out= median_chol median= baseline_median; run; *create new variable*; Data Combo_cholesterol; set Combo_nodup; If B_cholesterol <= baseline_median then CholGroup= 'less than or equal to median'; else CholGroup= 'more than median'; run; proc print data= Combo_cholesterol; run;
So this produces a table, however, the variable baseline_median gives a '.' for every observation I feel like I may not have combined in my Set statement?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
