Generalized R2

A generalized version of the goodness-of-fit statistic R2 can be obtained by taking the squared correlation between the actual values of the dependent variable and those predicted by the regres­sion. The following script reproduces the results from section 4.4.4 of your textbook.

1 open "@gretldirdatapoecps4_small. gdt"

2 logs wage

3 ols l_wage const educ

4 series y = exp($yhat)

5 scalar corr1 = corr(y, wage)

6 scalar Rsquare = corr1"2

7 print corrl Rsquare

This yields an estimated correlation of 0.4312 and a squared correlation of 0.1859.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>