Help using Base SAS procedures

Proc Means Excel File Sheet

Accepted Solution Solved
Reply
Contributor
Posts: 23
Accepted Solution

Proc Means Excel File Sheet

proc means data=OSCE_Neph nway nmiss mean std skew Median;

class Station SP_MD;

var Q1resp Q2Resp Q3Resp Q4Resp Q5Resp Q6Resp;

output out = StationsData mean= std= skew= Median=;

run;

How can i get the Mean Std Skew Median of the responses in the final data set? Also in stationsdata i get _type_ as 3 in the rows. Why is that?

Thanks,

Thomas


Accepted Solutions
Solution
‎03-07-2012 11:28 AM
PROC Star
Posts: 7,364

Re: Proc Means Excel File Sheet

Thomas,

To get what you want add the autoname option.

You are getting type=3 because you used the nway option which is giving you only the highest level breakdown, which I presume is what you want.  You can eliminate that from your output file with a drop statement.  e.g.:

proc means data=OSCE_Neph

      nway nmiss mean std skew Median noprint;

  class Station SP_MD;

  var Q1resp Q2Resp Q3Resp Q4Resp Q5Resp Q6Resp;

  output out = StationsData (drop=_Smiley Happy

         mean= std= skew= Median= /autoname;

run;

View solution in original post


All Replies
Solution
‎03-07-2012 11:28 AM
PROC Star
Posts: 7,364

Re: Proc Means Excel File Sheet

Thomas,

To get what you want add the autoname option.

You are getting type=3 because you used the nway option which is giving you only the highest level breakdown, which I presume is what you want.  You can eliminate that from your output file with a drop statement.  e.g.:

proc means data=OSCE_Neph

      nway nmiss mean std skew Median noprint;

  class Station SP_MD;

  var Q1resp Q2Resp Q3Resp Q4Resp Q5Resp Q6Resp;

  output out = StationsData (drop=_Smiley Happy

         mean= std= skew= Median= /autoname;

run;

Contributor
Posts: 23

Proc Means Excel File Sheet

Thanks a lot art. I appreciate it. It worked. But i have a question. Will the proc step give me an overall means? Cos right i get the means of each question. Can i get the means of all the stations in the proc step? Or do i have to write another data step for that.

Thanks much.

PROC Star
Posts: 7,364

Proc Means Excel File Sheet

Remove the nway and drop options.  That way you will get all of the combinations specified in your class statement.

Super User
Posts: 9,687

Proc Means Excel File Sheet

proc sql;

select mean(mean(Q1resp,Q2Resp,Q3Resp,Q4Resp,Q5Resp,Q6Resp)) as grand_mean

  from OSCE_Neph ;

quit;

Ksharp

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 172 views
  • 2 likes
  • 3 in conversation