* F-Test for the Earnings Equation
*
* Keywords:
* regression, ols, log, earnings, equation, f-test, married, women
*
* Description:
* We illustrate how to do an F-Test on a Multiple OLS model for the Earnings
* Equation of married women
*
* Author(s):
* Noel Roy
* Skif Pankov
*
* Source:
* William H. Greene, Econometric Analysis - 7th Edition
* Pearson International Edition, Chapter 5, Example 5.5 (page 166)
*
sample 1 753
* Reading the datafile and naming the variables, specifying to ignore the
* first 37 lines of the file
read (TableF5-1.shd) lfp whrs kl6 k618 age educ ww / skiplines=37
* Instructing not to display a warning when an observation is skipped -
* the model requires us to skip around 300 observations in our data
set nowarnskip
* Instructing to skip an observation if (1-lfp) is equal to 1 (is TRUE) - i.e.,
* when a woman does not work
skipif (1-lfp)
* Generating the natural log of weekly earnings, square of age and the
* dummy indicating whether this woman has kids
genr lnearn=log(ww*whrs)
genr age2=age**2
genr kids=dum(kl6+k618)
* Running an OLS regression of lnearn on age, age2, educ and kids, specifying
* to include the anova tables with F-tests and that the model is log-linear
ols lnearn age age2 educ kids / anova loglin
* Alternatively, he formula for the f-statistic can be calculated with the use of
* "temporary variables"
* Manually calculating the F-ratio for testing the hypothesis that the four
* slope coefficients are zero
gen1 $r2/($k-1)/((1-$r2)/($n-$k))
stop