Sunteți pe pagina 1din 5

COMMANDS

data smoke; infile 'smoke.txt'; input cigs income cigpric edu age restaurn; logincome = log(income); logcigpric = log(cigpric); age2=age*age; run; proc print; run; proc means; run; proc reg data=smoke; model cigs = logincome logcigpric edu age age2 restaurn; run; proc reg data=smoke; model cigs = logincome logcigpric edu age age2 restaurn/acov spec; run; proc reg data=smoke; model cigs = logincome logcigpric edu age age2 restaurn/acov spec; test logincome=0, edu=0; run; proc reg data=smoke; model cigs = logincome logcigpric edu age age2 restaurn; output out= sample r=uhat; run; proc print data=sample; run; data sample; set sample; uhat2=uhat*uhat; loguhat2=log(uhat2); run; proc print data=sample; run; proc reg data=sample; model loguhat2 = logincome logcigpric edu age age2 restaurn; output out= sample p=ghat; test logincome=0, logcigpric=0, edu=0, age=0, age2=0, restaurn=0; run; data sample; set sample; hhat= 1/exp(ghat); run; proc print data= sample; run; proc reg data=sample; model cigs = logincome logcigpric edu age age2 restaurn / spec; weight hhat;

WHITE TEST

title3 'GLS regression'; run; Results:

Q2 (a)
The SAS System 09:44 Thursday, February 26, 2009 17 The REG Procedure Model: MODEL1 Dependent Variable: cigs Number of Observations Read Number of Observations Used Analysis of Variance Source DF Sum of Squares Mean Square F Value 7.42 Pr > F <.0001 807 807

Model 6 8003.02492 1333.83749 Error 800 143751 179.68832 Corrected Total 806 151754

Root MSE 13.40479 R-Square 0.0527 Dependent Mean 8.68649 Adj R-Sq 0.0456 Coeff Var 154.31759 Parameter Estimates Variable Parameter Standard DF Estimate Error 1 t Value Pr > |t|

Intercept 1 logincome logcigpric 1 edu 1 age 1 age2 1 restaurn 1

-3.63982 24.07866 -0.15 0.8799 0.88027 0.72778 1.21 0.2268 -0.75086 5.77334 -0.13 0.8966 -0.50150 0.16708 -3.00 0.0028 0.77069 0.16012 4.81 <.0001 -0.00902 0.00174 -5.18 <.0001 -2.82508 1.11179 -2.54 0.0112 09:44 Thursday, February 26, 2009 19

Q2(b)
The SAS System The REG Procedure Model: MODEL1 Dependent Variable: cigs Variable Consistent Covariance of Estimates Intercept logincome logcigpric edu

Intercept 650.51103309 -2.642467179 -149.8136691 -0.240228531 logincome -2.642467179 0.3521482505 0.008733758 -0.029254378 logcigpric -149.8136691 0.008733758 36.110106952 0.0481489854 edu -0.240228531 -0.029254378 0.0481489854 0.0261429028 age -0.489137676 -0.018750239 0.0775258566 -0.000808723 age2 0.0051075375 0.0001923733 -0.000858127 0.0000170051 restaurn 3.8226853285 -0.076836362 -0.783483342 -0.012436503 Consistent Covariance of Estimates Variable age age2 restaurn

Intercept -0.489137676 0.0051075375 3.8226853285 logincome -0.018750239 0.0001923733 -0.076836362 logcigpric 0.0775258566 -0.000858127 -0.783483342 edu -0.000808723 0.0000170051 -0.012436503 age 0.0189566233 -0.000197847 -0.002485327 age2 -0.000197847 2.1194381E-6 0.0000260324 restaurn -0.002485327 0.0000260324 1.0073157152 Test of First and Second Moment Specification DF 25 Chi-Square 71.57 Pr > ChiSq WHITE TEST <.0001

H0= Homoskedastic H1= Heteroskedastic Yes, there is the evidence of heteroskedasticity and which is clear from the probability above which very very small i.e. pr > Chisq = <.0001 indicating that at say 5% significance level we can reject our null that the data is homoskedastic . Also the Chisq value(71.57) is greater than Chisq critical value, therefore there is a clear evidence of heteroskedasticity. Q2(c) Test whether coefficients of log(income) and educ are significant or not using the heteroskedastic-robust standard errors. Report the results of the tests. Test 1:
The SAS System 09:44 Thursday, February 26, 2009 40 The REG Procedure Model: MODEL1 Test 1 Results for Dependent Variable cigs Source Numerator Denominator DF Mean Square F Value 4.61 Pr > F 0.0102

2 828.62985 800 179.68832

Test 2

The REG Procedure Model: MODEL1 Dependent Variable: cigs Test 1 Results using ACOV estimates DF 2 Chi-Square 9.94 Pr > ChiSq 0.0069

Q3(c) Run the regression of log(uhat2) on the same set of the regressors and save the fitted values; call these ghat. Are these regressors jointly significant?
The REG Procedure Model: MODEL1 Dependent Variable: loguhat2 Number of Observations Read Number of Observations Used Analysis of Variance 807 807

Source

DF

Sum of Squares

Mean Square

F Value 43.82

Pr > F <.0001

Model 6 535.30352 89.21725 Error 800 1628.74724 2.03593 Corrected Total 806 2164.05076

Root MSE 1.42686 R-Square 0.2474 Dependent Mean 4.20749 Adj R-Sq 0.2417 Coeff Var 33.91245 Parameter Estimates Variable Parameter Standard DF Estimate Error t Value Pr > |t|

Intercept 1 -1.92069 2.56303 -0.75 0.4538 logincome 1 0.29154 0.07747 3.76 0.0002 logcigpric 1 0.19542 0.61454 0.32 0.7506 edu 1 -0.07970 0.01778 -4.48 <.0001 age 1 0.20401 0.01704 11.97 <.0001 age2 1 -0.00239 0.00018554 -12.89 <.0001 restaurn 1 -0.62701 0.11834 -5.30 <.0001 The REG Procedure Model: MODEL1 Test 1 Results for Dependent Variable loguhat2 Source DF Mean Square F Value Pr > F

Numerator 6 89.21725 43.82 <.0001 Denominator 800 2.03593 Above test shows that these regressors are jointly significant since the p-value of the F-test is very very small.

Q3(e)
The SAS System 09:44 Thursday, February 26, 2009 81 GLS regression The REG Procedure Model: MODEL1 Dependent Variable: cigs Number of Observations Read Number of Observations Used Weight: hhat Analysis of Variance Source DF Sum of Squares Mean Square F Value 17.06 Pr > F <.0001 807 807

Model 6 255.04322 42.50720 Error 800 1993.83090 2.49229 Corrected Total 806 2248.87413

Root MSE 1.57870 R-Square 0.1134 Dependent Mean 5.02187 Adj R-Sq 0.1068 Coeff Var 31.43647 Parameter Estimates

Variable

Parameter Standard DF Estimate Error

t Value

Pr > |t|

Intercept 1 5.63547 17.80314 0.32 0.7517 logincome 1 1.29524 0.43701 2.96 0.0031 logcigpric 1 -2.94031 4.46014 -0.66 0.5099 edu 1 -0.46345 0.12016 -3.86 0.0001 age 1 0.48195 0.09681 4.98 <.0001 age2 1 -0.00563 0.00093948 -5.99 <.0001 restaurn 1 -3.46106 0.79551 -4.35 <.0001

Q3(f)
The SAS System 09:44 Thursday, February 26, 2009 82 GLS regression The REG Procedure Model: MODEL1 Dependent Variable: cigs Test of First and Second Moment Specification DF 26 Chi-Square 31.83 Pr > ChiSq 0.1987 WHITE TEST

H0= Homoskedastic H1= Heteroskedastic


The above result shows that the data is no more heteroscadastic as the prob now is 0.1985 and at 5% significance level we fail to reject our null (01987>0.05).

S-ar putea să vă placă și