SHAZAM Community
Ask Your Question
0

Residual variance

asked 2011-10-28 12:41:44 +0000

Jack gravatar image

updated 2011-10-28 15:55:20 +0000

Hi should I use the following code to save the residual variance:

assuming sample 1 to 20

OLS Y X  / PREDICT=YPRED
GENR RES=(Y-YPRED)**2
GEN1 RVAR=(1/(20-1))*Sum(RES)

Maybe i am missing something..I did not get the residual variance.Please help.

edit retag flag offensive close merge delete

Comments

GEN1 is the same as SAMPLE 1 1 and GENR so this will only make this calculation for the 1st observation. To make this work try. GENR RVAR=SUM(RES,20)/18 where 18 is N-K. This will match the output from LIST

SHAZAMHelp gravatar imageSHAZAMHelp ( 2011-10-28 16:14:29 +0000 )edit

Thank you. But N-K= 20-1=19. (no constant)

Jack gravatar imageJack ( 2011-10-28 16:59:00 +0000 )edit

In the above a constant is automatically inserted. To exclude a constant use the NOCONSTANT option.

SHAZAMHelp gravatar imageSHAZAMHelp ( 2011-10-28 17:23:10 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2011-10-28 15:58:52 +0000

updated 2011-10-28 17:23:57 +0000

Try the LIST option which prints this for you.

eg.

ols Y X / list

Further descriptions on these sorts of calculations are here:

http://shazam.econ.ubc.ca/student/hill/SHAZAM.pdf

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2011-10-28 12:41:44 +0000

Seen: 379 times

Last updated: Oct 28 '11

Related questions