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
- /
- Mean-differencing a Series

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
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-06-2009 10:57 PM

Greetings:

Is there a simple solution to calculate mean difference? That is, if I have series, say, X = x1, ..., xn. I can calculate difference of two values defining a new variable as:

d_X = dif(X);

What if I want to calculate the difference of each observation from the mean of the series? Is there a simple way to do this instead of calculating the mean and then subtracting it from each observation? That is, say,:

d_mX = (X - mean(X));

I am sure there is one, I just cannot find the command. (By the way, "meandif" is not a valid command for this.)

I appreciate your help.

Best,

Mitu Message was edited by: ashraf

Is there a simple solution to calculate mean difference? That is, if I have series, say, X = x1, ..., xn. I can calculate difference of two values defining a new variable as:

d_X = dif(X);

What if I want to calculate the difference of each observation from the mean of the series? Is there a simple way to do this instead of calculating the mean and then subtracting it from each observation? That is, say,:

d_mX = (X - mean(X));

I am sure there is one, I just cannot find the command. (By the way, "meandif" is not a valid command for this.)

I appreciate your help.

Best,

Mitu Message was edited by: ashraf

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

Posted in reply to ashraf

07-07-2009 09:13 AM

Suggest searching the SAS support http://support.sas.com/ using the website SEARCH facility or possibly using a Google advanced search argument (sample below):

mean difference site:sas.com

Scott Barry

SBBWorks, Inc.

mean difference site:sas.com

Scott Barry

SBBWorks, Inc.

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

07-07-2009 11:47 AM

Thanks Scott. One solution that I found late last night was STDIZE procedure.

Mitu

Mitu