Residual variance

i like this post (click again to cancel)
0
i dont like this post (click again to cancel) remove favorite mark from this question (click again to restore mark)

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.

asked Oct 28 '11

Jack gravatar image Jack
1 1

updated Oct 28 '11

SHAZAMHelp gravatar image SHAZAMHelp 332 1 5 16
http://econometrics.com/
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 (Oct 28 '11)
Thank you. But N-K= 20-1=19. (no constant) - Jack (Oct 28 '11)
In the above a constant is automatically inserted. To exclude a constant use the NOCONSTANT option. - SHAZAMHelp (Oct 28 '11)
i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

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

link

posted Oct 28 '11

SHAZAMHelp gravatar image SHAZAMHelp 332 1 5 16
http://econometrics.com/

updated Oct 28 '11

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Tags:

×1
×1

Asked: Oct 28 '11

Seen: 56 times

Last updated: Oct 28 '11

Related questions