in proc means one can use CLM to get the confidence interval of the mean. How to output the CLM to a dataset?
proc means data=adxe N NMISS CLM ;
by trtp;
var aval;
where aval >.;
/* output out=TFMT2RD n=n mean=mean std=sd median=median min=min max=max q1=q1 q3=q3 ;*/
run;
in proc univariate, what is the option to do thid? cibasic (alpha=0.05)?
what are the output options to get the 95% CI of mean?
proc univariate data=adxe cibasic (alpha=0.05) noprint;
by trtp;
var aval;
where aval >.;
output out=TFMT2RD n=n mean=mean std=sd median=median min=min max=max q1=q1 q3=q3 ;
run;
Note: You can also output them directly, but the above method is a lot more versatile. Additionally, if you use any of the special missing values (e.g., .A, .B, etc), you can capture all of them by using where not missing(variablename). e.g.:
data class; set sashelp.class; if _n_ in (2,4,6) then weight=.; else if _n_ in (3,5,7) then weight=.A; run; proc means data=class N NMISS CLM nway ; class sex; var weight; where weight >.; output out=want /autoname; run; proc summary data=class N NMISS CLM nway; class sex; var weight; where weight >.; output out=want2 /autoname; run; proc means data=class N NMISS CLM nway ; class sex; var weight; where not missing(weight); output out=want3 /autoname; run; proc summary data=class N NMISS CLM nway; class sex; var weight; where not missing(weight); output out=want4 /autoname; run;
Art, CEO, AnalystFinder.com
You can use the following method with any procedure:
ods trace on; proc means data=sashelp.class N NMISS CLM; class sex; var weight; where weight >.; /* output out=TFMT2RD n=n mean=mean std=sd median=median min=min max=max q1=q1 q3=q3 ;*/ run; ods trace off; /*get the name of the desired file from the log*/ ods output Means.Summary=want; proc means data=sashelp.class N NMISS CLM; class sex; var weight; where weight >.; /* output out=TFMT2RD n=n mean=mean std=sd median=median min=min max=max q1=q1 q3=q3 ;*/ run;
Art, CEO, AnalystFinder.com
Note: You can also output them directly, but the above method is a lot more versatile. Additionally, if you use any of the special missing values (e.g., .A, .B, etc), you can capture all of them by using where not missing(variablename). e.g.:
data class; set sashelp.class; if _n_ in (2,4,6) then weight=.; else if _n_ in (3,5,7) then weight=.A; run; proc means data=class N NMISS CLM nway ; class sex; var weight; where weight >.; output out=want /autoname; run; proc summary data=class N NMISS CLM nway; class sex; var weight; where weight >.; output out=want2 /autoname; run; proc means data=class N NMISS CLM nway ; class sex; var weight; where not missing(weight); output out=want3 /autoname; run; proc summary data=class N NMISS CLM nway; class sex; var weight; where not missing(weight); output out=want4 /autoname; run;
Art, CEO, AnalystFinder.com
I am a little confused don't you get the intervals
title 'Analysis of Female Heights';
ods select BasicIntervals;
proc univariate data=sashelp.class cibasic;
var Height;
run;
The UNIVARIATE Procedure
Variable: HEIGHT
Basic Confidence Limits Assuming Normality
Parameter Estimate 95% Confidence Limits
Mean 62.33684 59.86567 64.80801
Std Deviation 5.12708 3.87408 7.58204
Variance 26.28690 15.00852 57.48740
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!
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.