gretl version 1.9.12 Current session: 2013-04-09 16:50 # ESERCIZI E4.1, E5.1, E6.1 # OCCHIO, questo percorso vale sul mio computer, sul vostro sara' diverso ? open "/Users/fausto/Library/Application \ Support/gretl/data/stock_watson_2/CPS04.gdt" Read datafile /Users/fausto/Library/Application Support/gretl/data/stock_watson_2/CPS04.gdt periodicity: 1, maxobs: 7986 observations range: 1 to 7986 Listing 5 variables: 0) const 1) ahe 2) bachelor 3) female 4) age # model 1 ? ols ahe const age --robust Model 1: OLS, using observations 1-7986 Dependent variable: ahe Heteroskedasticity-robust standard errors, variant HC1 coefficient std. error t-ratio p-value -------------------------------------------------------- const 3.32418 0.965696 3.442 0.0006 *** age 0.451931 0.0329673 13.71 2.72e-42 *** Mean dependent var 16.77115 S.D. dependent var 8.758696 Sum squared resid 598935.5 S.E. of regression 8.661234 R-squared 0.022254 Adjusted R-squared 0.022131 F(1, 7984) 187.9219 P-value(F) 2.72e-42 Log-likelihood −28571.28 Akaike criterion 57146.55 Schwarz criterion 57160.52 Hannan-Quinn 57151.33 # Bob ? genr yhat_bob = $coeff(const) + $coeff(age)*26 Generated scalar yhat_bob = 15.0744 # Alexis ? genr yhat_alexis = $coeff(const) + $coeff(age)*30 Generated scalar yhat_alexis = 16.8821 # No solo il 2% della varianza totale e' spiegato da age # Si', lo slope e' significativo # intervallo di confidenza per lo slope al 95% ? genr CIslope_hi = $coeff(age)+1.96*$stderr(age) Generated scalar CIslope_hi = 0.516547 ? genr CIslope_lo = $coeff(age)-1.96*$stderr(age) Generated scalar CIslope_lo = 0.387315 # Campione ristretto ai diplomati ? smpl bachelor==0 --restrict Full data set: 7986 observations Current sample: 4346 observations # model 2 ? ols ahe const age --robust Model 2: OLS, using observations 1-4346 Dependent variable: ahe Heteroskedasticity-robust standard errors, variant HC1 coefficient std. error t-ratio p-value -------------------------------------------------------- const 6.20009 1.01564 6.105 1.12e-09 *** age 0.255720 0.0344032 7.433 1.27e-13 *** Mean dependent var 13.80961 S.D. dependent var 6.729093 Sum squared resid 194362.1 S.E. of regression 6.688996 R-squared 0.012109 Adjusted R-squared 0.011882 F(1, 4344) 55.25011 P-value(F) 1.27e-13 Log-likelihood −14425.12 Akaike criterion 28854.24 Schwarz criterion 28867.00 Hannan-Quinn 28858.75 # Back to full sample ? smpl full Full data range: 1 - 7986 (n = 7986) # Restringiamo il campione ai laurati ? smpl bachelor==1 --restrict Full data set: 7986 observations Current sample: 3640 observations # model 3 ? ols ahe const age --robust Model 3: OLS, using observations 1-3640 Dependent variable: ahe Heteroskedasticity-robust standard errors, variant HC1 coefficient std. error t-ratio p-value -------------------------------------------------------- const −0.232686 1.54781 −0.1503 0.8805 age 0.690387 0.0528546 13.06 3.86e-38 *** Mean dependent var 20.30709 S.D. dependent var 9.554442 Sum squared resid 317747.7 S.E. of regression 9.345658 R-squared 0.043490 Adjusted R-squared 0.043227 F(1, 3638) 170.6158 P-value(F) 3.86e-38 Log-likelihood −13299.01 Akaike criterion 26602.03 Schwarz criterion 26614.43 Hannan-Quinn 26606.45 # Back to full sample ? smpl full Full data range: 1 - 7986 (n = 7986) # Si', per i laureati l'effetto eta' e' maggiore # model 4 ? ols ahe const age female bachelor --robust Model 4: OLS, using observations 1-7986 Dependent variable: ahe Heteroskedasticity-robust standard errors, variant HC1 coefficient std. error t-ratio p-value --------------------------------------------------------- const 1.88380 0.897242 2.100 0.0358 ** age 0.439204 0.0301511 14.57 1.85e-47 *** female −3.15786 0.175588 −17.98 6.39e-71 *** bachelor 6.86515 0.185029 37.10 3.84e-278 *** Mean dependent var 16.77115 S.D. dependent var 8.758696 Sum squared resid 496180.7 S.E. of regression 7.884317 R-squared 0.189998 Adjusted R-squared 0.189694 F(3, 7982) 545.3021 P-value(F) 0.000000 Log-likelihood −27819.74 Akaike criterion 55647.48 Schwarz criterion 55675.42 Hannan-Quinn 55657.04 # IC per il coeff di age ? genr CIslope_hi = $coeff(age)+1.96*$stderr(age) Replaced scalar CIslope_hi = 0.4983 ? genr CIslope_lo = $coeff(age)-1.96*$stderr(age) Replaced scalar CIslope_lo = 0.380108 # Bob ancora ? genr yhat_bob_again = $coeff(const) + $coeff(age)*25 + $coeff(female)*0 + \ $coeff(bachelor)*0 Generated scalar yhat_bob_again = 12.8639 # Alexis ancora ? genr yhat_alexis_again = $coeff(const) + $coeff(age)*30 + $coeff(female)*1 + \ $coeff(bachelor)*1 Generated scalar yhat_alexis_again = 18.7672 # F test ? omit female bachelor --test-only Test on Model 4: Null hypothesis: the regression parameters are zero for the variables female, bachelor Test statistic: Robust F(2, 7982) = 752.951, p-value 2.76557e-300