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

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;

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

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

View solution in original post

3 REPLIES 3
art297
Opal | Level 21

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

 

art297
Opal | Level 21

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

rogerjdeangelis
Barite | Level 11
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

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
  • 3 replies
  • 24066 views
  • 0 likes
  • 3 in conversation