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

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

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

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=_:)

         mean= std= skew= Median= /autoname;

run;

View solution in original post

4 REPLIES 4
art297
Opal | Level 21

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=_:)

         mean= std= skew= Median= /autoname;

run;

ThomasGeorge
Calcite | Level 5

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.

art297
Opal | Level 21

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

Ksharp
Super User

proc sql;

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

  from OSCE_Neph ;

quit;

Ksharp

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
  • 4 replies
  • 807 views
  • 2 likes
  • 3 in conversation