BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Dear SAS users:

I am trying to calculate means and confidence intervals for multiple variables (e.g 38 variables), listed in a table as 38 columns. My sas code is attached below. Somehow, the means and std can be calculated and print in the window, but the output file (out=tmp) only shows the result for the first variable V1. I am hoping get some help to have the full table with all the variable in it.The output is as follows:

_TYPE_ _FREQ_ n mean stderr lclm uclm
0 96 96 2.701145833 0.038329101 2.625052948 2.777238719

Thanks

pharmpk



filename datain
'd:\ ......csv';

data fulldata;
infile datain DELIMITER=',';
input Prob V1 V2 V3 .....V38;
if prob EQ _blank_ THEN delete;
drop _blank_;
run;

Proc means data=fulldata alpha=0.05;
var V1 V2 V3 .....V38;
OUTPUT OUT=tmp N=n MEAN=mean STDERR=stderr LCLM=lclm UCLM=uclm;
run;
3 REPLIES 3
Paige
Quartz | Level 8
OUTPUT OUT=tmp N=n1-n38 MEAN=mean1-mean38 STDERR=stderr1-stderr38 LCLM=lclm1-lclm38 UCLM=uclm1-uclm38;
Doc_Duke
Rhodochrosite | Level 12
You are missing the <(variable)> specification in your OUTPUT statement. See the documentation and examples.

statistic-keyword<(variable-list)>=

would look like

mean(V1 V2)=MeanV1 MeanV2

to get means for V1 and V2.

If you want one row per variable, use TRANSPOSE first to rearrange and add a CLASS statement to PROC MEANS.
deleted_user
Not applicable
Thank you very much!

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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