turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- proc means, output out, standard deviation for mea...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-22-2012 10:19 AM

Howdy

How would I output the results from a proc means to a SAS data set? I know how to output out a mean of a collapsed variable but I also need to output out the standard deviation for each collapsed variable.

Here is what I can do:

proc means data=digit;

by x;

var y;

output out=means mean=ybar;

run;

Is there a statement I could use to create a std dev for y?

I appreciate any help someone could give me.

Accepted Solutions

Solution

03-22-2012
10:27 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to jdub

03-22-2012 10:27 AM

I'm not sure what you mean by collapsed variable but to add standard deviation to your output add

std= ystd after mean=ybar.

If you want to process more variables such as with :

var var1 var2 var3 ... ;

you could use

output out=<datasetname> mean= std= <other requested statistics> / autoname;

The autoname option will create variable names based on your variable name and the requested statistic so you don't have to.

All Replies

Solution

03-22-2012
10:27 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to jdub

03-22-2012 10:27 AM

I'm not sure what you mean by collapsed variable but to add standard deviation to your output add

std= ystd after mean=ybar.

If you want to process more variables such as with :

var var1 var2 var3 ... ;

you could use

output out=<datasetname> mean= std= <other requested statistics> / autoname;

The autoname option will create variable names based on your variable name and the requested statistic so you don't have to.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

03-22-2012 10:48 AM

thank ya.

by collapsed obs I was trying to say that the mean of y was generated by x over a basket of time points but did a poor job of communicating this