BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
You just need to add uclm and lclm to your list of statistics in Proc means.

View solution in original post

4 REPLIES 4
Ksharp
Super User
proc surveymeans data=sashelp.class geomean gmclm allgeo;
var weight;
run;
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Use alpha and uclm lclm:

proc means data=sashelp.class alpha=0.05;
 class sex;
 var height; 
 output out=want lclm=lclm uclm=uclm;
run;

For geometric, its just a matter of log()'ing values which are > 0 and using them in the proc means.

Reeza
Super User
You just need to add uclm and lclm to your list of statistics in Proc means.
DmytroYermak
Lapis Lazuli | Level 10

Thank you! 

 

Here it is the final version:

 

ods output Summary = pretable3;
proc means data=pretable2 nmiss mean std cv min median max lclm uclm alpha=0.05;
 class PARAMN PARAMCD PARAM TRT01A;
 var QVAL LN_QVAL; 
run;


data pretable4 ; *** Putting values into character***;
  format Geom_mean_C Geom_cv_C Geom_LCLM_C Geom_UCLM_C $200.;
  set pretable3;
  NObs_C = put(NObs,8.0);
  QVAL_Mean_C = put(QVAL_Mean,8.3);
  QVAL_StdDev_C = put(QVAL_StdDev,8.4);
  QVAL_Min_C = put(QVAL_Min,8.2);
  QVAL_Median_C = put(QVAL_Median,8.3);
  QVAL_Max_C = put(QVAL_Max,8.2);
  if LN_QVAL_Mean ne . then do; Geom_mean_C = strip(put(exp(LN_QVAL_Mean),8.3)); Geom_LCLM_C = strip(put(exp(LN_QVAL_LCLM),8.3)); Geom_UCLM_C = strip(put(exp(LN_QVAL_UCLM),8.3));end;
  if LN_QVAL_StdDev ne . then do; Geom_cv_C   = strip(put((sqrt(exp(LN_QVAL_StdDev**2)-1))*100,8.4)); end;
  QVAL_CV_C = put(QVAL_CV,8.4);
run; *** end of Putting values into character***;

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 6130 views
  • 2 likes
  • 4 in conversation