* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Third Edition, Wiley, 2008. * Chapter 8.3.3 A Heteroskedastic Partition * Chapter 8.4.2 The Goldfeld-Quandt Test SAMPLE 1 1000 READ (cps2.shd) wage educ exper female black married union south fulltime metro * Estimation results for Equation (8.28) page 208. OLS wage educ exper metro * Sort the data so that the observations for the Metropolitan area * are the first group of observations. SORT metro wage educ exper / DESC * Find NM = the number of observations in the Metropolitan area STAT metro / SUMS=NM * Define a weight variable GENR WT=0 * Separate OLS regression for the two observation subsets * Metropolitan area SAMPLE 1 NM OLS wage educ exper * Save the estimated error variance in the weight variable GEN1 sigm=$SIG2 GEN1 dfm=$DF GENR WT=1/sigm * Outside a Metropolitan area GEN1 NM1=NM+1 SAMPLE NM1 1000 OLS wage educ exper GEN1 sigr=$SIG2 GEN1 dfr=$DF GENR WT=1/sigr * The Goldfeld-Quandt test statistic (Chapter 8.4.2, p. 212) GEN1 F=sigm/sigr * Get a p-value DISTRIB F / TYPE=F DF1=dfm DF2=dfr GEN1 pvalue=1-$CDF PRINT F pvalue * Get the generalized least squares (GLS) estimates SAMPLE 1 1000 * Equation (8.33), p. 210 OLS wage educ exper metro / WEIGHT=WT NONORM NOMULSIGSQ STOP