library(haven)
wagedata<-read_dta("WAGE1.DTA")
reg1<-lm(lwage~educ + exper + tenure, data = wagedata)
summary(reg1)
Call: lm(formula = lwage ~ educ + exper + tenure, data = wagedata) Residuals: Min 1Q Median 3Q Max -2.05802 -0.29645 -0.03265 0.28788 1.42809 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.284360 0.104190 2.729 0.00656 ** educ 0.092029 0.007330 12.555 < 2e-16 *** exper 0.004121 0.001723 2.391 0.01714 * tenure 0.022067 0.003094 7.133 3.29e-12 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.4409 on 522 degrees of freedom Multiple R-squared: 0.316, Adjusted R-squared: 0.3121 F-statistic: 80.39 on 3 and 522 DF, p-value: < 2.2e-16
meapdata<-read_dta("MEAP93.dta")
head(meapdata)
lnchprg | enroll | staff | expend | salary | benefits | droprate | gradrate | math10 | sci11 | totcomp | ltotcomp | lexpend | lenroll | lstaff | bensal | lsalary |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> | <dbl> |
1.4 | 1862 | 112.6 | 5765 | 37498 | 7420 | 2.9 | 89.2 | 56.4 | 67.9 | 44918 | 10.71259 | 8.659560 | 7.529407 | 4.723842 | 0.1978772 | 10.53204 |
2.3 | 11355 | 101.2 | 6601 | 48722 | 10370 | 1.3 | 91.4 | 42.7 | 65.3 | 59092 | 10.98685 | 8.794976 | 9.337414 | 4.617099 | 0.2128402 | 10.79389 |
2.7 | 7685 | 114.0 | 6834 | 44541 | 7313 | 3.5 | 91.4 | 43.8 | 54.3 | 51854 | 10.85619 | 8.829665 | 8.947025 | 4.736198 | 0.1641858 | 10.70417 |
3.4 | 1148 | 85.4 | 3586 | 31566 | 5989 | 3.6 | 86.6 | 25.3 | 60.0 | 37555 | 10.53356 | 8.184793 | 7.045776 | 4.447346 | 0.1897295 | 10.35984 |
3.4 | 1572 | 96.1 | 3847 | 29781 | 5545 | 0.0 | 100.0 | 15.3 | 65.8 | 35326 | 10.47237 | 8.255049 | 7.360104 | 4.565389 | 0.1861925 | 10.30163 |
3.4 | 2496 | 101.1 | 5070 | 36801 | 5895 | 2.7 | 89.2 | 46.0 | 60.5 | 42696 | 10.66186 | 8.531096 | 7.822445 | 4.616110 | 0.1601859 | 10.51328 |
reg2<-lm(math10~enroll + totcomp + staff, data = meapdata)
summary(reg2)
Call: lm(formula = math10 ~ enroll + totcomp + staff, data = meapdata) Residuals: Min 1Q Median 3Q Max -22.235 -7.008 -0.807 6.097 40.689 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.2740209 6.1137938 0.372 0.710 enroll -0.0001976 0.0002152 -0.918 0.359 totcomp 0.0004586 0.0001004 4.570 6.49e-06 *** staff 0.0479199 0.0398140 1.204 0.229 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 10.24 on 404 degrees of freedom Multiple R-squared: 0.05406, Adjusted R-squared: 0.04704 F-statistic: 7.697 on 3 and 404 DF, p-value: 5.179e-05