Help using Base SAS procedures

Proc means simple question

Reply
Occasional Contributor
Posts: 9

Proc means simple question

Hi

I have to tabulate the N,mean,stddev of acess data set. My code for that is below

proc means data=Sasuser.ClinicalExam nonobs n mean stddev maxdec=2;
label pulse = 'pulse'
Bpsytolic = 'Systolic BP'
BpDiastolic = 'Diastolic BP';
Var pulse bpsys bpdias;
run;

My result is having 5 columns :

variable label N mean stddev

but i shud have only the below in result :

Label N Mean Stddev

how to ignore Variable column fro the result ?
Super User
Posts: 11,343

Re: Proc means simple question

Quickest would be to use Tabulate:

Proc tabulate data=Sasuser.ClinicalExam ;
label pulse = 'pulse'
Bpsytolic = 'Systolic BP'
BpDiastolic = 'Diastolic BP';
Var pulse bpsys bpdias;

table pulse bpsys bpdias, n mean*f=f10.2 stddev*f=f10.2;
run;

Also,since you don't have and CLASS variables you don't need the NONOBS in your MEANS example.
Occasional Contributor
Posts: 9

Re: Proc means simple question

Thanks.But i have to get column name 'Label' above pulse,bpsystolic and bpdiastolic
Super User
Posts: 11,343

Re: Proc means simple question

table pulse bpsys bpdias, n mean*f=f10.2 stddev*f=f10.2
/box='Label';

will put Label at the top of the column of variables.
Ask a Question
Discussion stats
  • 3 replies
  • 152 views
  • 0 likes
  • 2 in conversation