This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: • Goodness of ﬁt Yi = Yi ⇒Yi = Yi + Yi − Yi ⇒Yi − Y = Yi − Y + Yi − Yi • Square both sides, (Yi − Y )2 = (Yi − Y )2 + (Yi − Yi )2 + 2(Yi − Y )(Yi − Yi ) • And then sum over all of i,
n n n n (Yi − Y )2 =
i=1 i=1 n i=1 (Yi − Y n (Yi − Y )2 +
i=1 (Yi − Yi )2 + 2
i=1 (Yi − Y )(Yi − Yi ) • It can be shown that 2 )(Yi − Yi ) = 0 (using that
n n u0 = i = 0 and (Yi − Yi )2
i=1 Yi ui = 0). Therefore, (Yi − Y )2 =
i=1 i=1 (Yi − Y )2 + • Labeling these, T SS = ESS + RSS or SST = SSE + SSR • Total, explained, and residual. In other words, the total variation can be decomposed into the variation that is explained by the model and the variation that is unexplained (related to the residuals) – From this, we can create a statistic that tells us how good our model is at explaining the data; simply put R2 = SSE/SST • Look at the stata data – http://www.cid.harvard.edu/ciddata/ciddata.html – Read it in graph drop _all set autotabgraphs on capture drop ghat* capture drop yhat* capture drop malfal2 reg gdp95 malfal94 predict ghat9 graph twoway (scatter gdp95 malfal94) (line ghat9 malfal94), name(g1) reg gdp65 malfal66 predict ghat6 graph twoway (scatter gdp65 malfal66) (line ghat6 malfal66), name(g2) reg gdp95 gdp90 predict yhat graph twoway (scatter gdp95 gdp90) (line yhat gdp90) 1 gen malfal2=malfal94^2 reg gdp95 malfal94 malfal2 predict ghat95 sort malfal94 graph twoway (line ghat95 malfal94) (scatter gdp95 malfal94), name(gq) graph twoway (qfit gdp95 malfal94) (scatter gdp95 malfal94) (lfit gdp95 malfal94), name(all) 2 ...
View Full Document
This note was uploaded on 10/23/2010 for the course STATISTICS 2 taught by Professor Ramirez during the Winter '09 term at USC.
- Winter '09