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
- /
- Analytics
- /
- Data Mining
- /
- How to extract intercept and residuals from a pane...

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

03-20-2013 08:08 PM

Hi i am estimating a dummy panel regression to remove seasonality.

The equation goes something like this

Y = intercept + b mon + b2 tue + b3 wed + b4 thrsday + e

Now i want to calculate a variable which would be intercept+ e

i am using proc reg with a "by" variable

how to extract only the intercept and residual as a seperate data set.

I know how to extract residual , but extracting intercept is very tricky . By using outest command it gives me a very jumbled data set with alot of other observations too.

Is there any efficient way???

Thanks in advance for helping

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

Posted in reply to Ahmad

03-20-2013 08:47 PM

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

Posted in reply to Ahmad

03-20-2013 09:45 PM

It is quite straitforward to combine OUTEST= and OUT= datasets :

**proc reg data=myData outest=myParms;****by myByVar;****model Y = mon tue wed thrsday;****output out=myRes r=resid;****run;**

**proc sql;****create table noSeason as****select R.myByVar, P.intercept + R.resid as Yp****from myParms as P inner join myRes as R on P.myByVar=R.myByVar****where P._TYPE_="PARMS";****quit;**

PG

PG

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

Posted in reply to PGStats

03-20-2013 10:06 PM

Thanks alot really appreciate

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

Posted in reply to PGStats

03-28-2013 05:39 PM

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

Posted in reply to Ahmad

03-28-2013 09:40 PM

How is your date variable related to your other variables, especially to your BY variable(s)?

PG

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

Posted in reply to PGStats

03-28-2013 09:45 PM

it is a panel data basically, for 500 stocks , daily data over 7 years. so my by variable is the stock name, which is to say o am estimating regression for every stock seperately,

i managed to get the desired result by manipulating the code you provided , kindly check if i have done it right or if there is a more efficient way kindly suggest that

proc sql;

create table noSeason1 as

select R.codneg, P.intercept + R.resid as Yp ,date

from myres as R inner join Myparms as P on R.codneg=P.codneg

where P._TYPE_="PARMS";

quit;

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

Posted in reply to Ahmad

03-28-2013 09:45 PM

where codneg is the stock name variable, and rest is all the same as you suggested

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

Posted in reply to Ahmad

03-28-2013 09:56 PM

That looks perfectly fine to me!

PG

PG

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

Posted in reply to PGStats

03-28-2013 09:58 PM