



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
upload documents to download the file i want
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!




> hoiquy1 <- lm(wage ~ educ + exper + tenure + feduc + black, data=wage2) > summary(hoiquy1) Call: lm(formula = wage ~ educ + exper + tenure + feduc + black, data = wage2) Residuals: Min 1Q Median 3Q Max
Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 366.2399 on 456 degrees of freedom Multiple R-squared: ????, Adjusted R-squared: ???? F-statistic: 19.08475 on 5 and 456 DF, p-value: < 2.2204e- 16
> hoiquy2 <- lm(wage ~ educ + exper + tenure + feduc:black, data=wage2) > summary(hoiquy2) Call: lm(formula = wage ~ educ + exper + tenure + feduc:black, data = wage2) Residuals: Min 1Q Median 3Q Max
Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: ???? on 457 degrees of freedom Multiple R-squared: 0.1524784, Adjusted R-squared: 0. F-statistic: ???? on ???? and ???? DF, p-value: 1.370351e- 15
F-statistic: ???? on ???? and ???? DF, p-value: 1.370351e- 15
> anova(hoiquy2) Analysis of Variance Table Response: wage Df Sum Sq Mean Sq F value Pr(>F) educ 1 8466681 8466680.6 61.72512 2.8505e- 14 *** exper 1 1476288 1476287.8 10.76266 0.0011149 ** tenure 1 559662 559662.3 4.08014 0.0439731 * feduc:black 1 775189 775188.9 5.65140 0.0178521 * Residuals 457 62685554 137167.
Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: ???? on 457 degrees of freedom
> hoiquy1 <- lm(colGPA ~ hsGPA+ACT+skipped+age, data=gpa1) > summary(hoiquy1) Call: lm(formula = colGPA ~ hsGPA + ACT + skipped + age, data = gpa1) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.90206 0.65037 1.387 0. hsGPA 0.43379 0.09709 4.468 1.65e- 05 *** ACT 0.01449 0.01058 1.370 0. skipped - 0.08066 0.02617 - 3.082 0.00249 ** age 0.01990 0.02284 0.872 0.
Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.32 98 on 136 degrees of freedom Multiple R-squared: 0.2379, Adjusted R-squared: 0. F-statistic: 10.61 on 4 and 136 DF, p-value: 1.635e- 07 > # Lay phan du > phandu1=resid(hoiquy1)
> jarqueberaTest(phandu1) Title: Jarque - Bera Normalality Test Test Results: STATISTIC: X-squared: 1. P VALUE: Asymptotic p Value: 0. > shapiro.test(phandu1) Shapiro-Wilk normality test data: phandu W = 0.9893, p-value = 0. > # Kiem dinh Anderson-Darling > ad.test(phandu1) Anderson-Darling normality test data: phandu A = 0.60863, p-value = 0. > # Kiem dinh Kolmogorov-Smirnov > lillie.test(phandu1) Lilliefors (Kolmogorov-Smirnov) normality test data: phandu D = 0.071506, p-value = 0.
> vif(hoiquy1) educ exper tenure feduc black 1.44735236 1.37408885 1.09224690 1.24655182 1.
> confint(hoiquy1, level = 0.93) 3.5 % 96.5 % (Intercept) - 529.473232136 31. educ 43.544904880 77. exper 5.507401655 22. tenure 0.587576229 13. feduc 9.613281792 30. black - 226.850020840 2.6668265 3
> linearHypothesis(hoiquy2, matchCoefs(hoiquy2, "exper|feduc")) Linear hypothesis test Hypothesis: exper = 0 feduc:black = 0 Model 1: restricted model Model 2: wage ~ educ + exper + tenure + feduc:black Res.Df RSS Df Sum of Sq F Pr(>F) 1 459 64375146 2 457 62685554 2 1689593 6.15887 0.0022943 **
> linearHypothesis(hoiquy1, c("exper=10")) Linear hypothesis test Hypothesis: exper = 10 Model 1: restricted model Model 2: wage ~ educ + exper + tenure + feduc + black Res.Df RSS Df Sum of Sq F Pr(>F) 1 457 61268287 2 456 61164032 1 104255.1 0.77726 0.3784 5