A

LEVEL-LEVEL

output1 <- lm(math10 ~ lnchprg, data=meap93)
summary(output1)
## 
## Call:
## lm(formula = math10 ~ lnchprg, data = meap93)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -24.386  -5.979  -1.207   4.865  45.845 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 32.14271    0.99758  32.221   <2e-16 ***
## lnchprg     -0.31886    0.03484  -9.152   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.566 on 406 degrees of freedom
## Multiple R-squared:  0.171,  Adjusted R-squared:  0.169 
## F-statistic: 83.77 on 1 and 406 DF,  p-value: < 2.2e-16
  1. The estimated regression equation:
    \(\widehat{math10}=32.14 - 0.32\ lnchprg\)

  2. Report and Discuss all GOF.
    The RMSE is 9.56 which is far from 0, hence we say that it is not a better fit.
    The \(R^2\) is 0.171 which is far from 100 also tells us that it is not a better fit. Hence, the model does not provide a good fit to the data.
    Moreover, lunch program explains about 17.1% of the variation in the percentage of 10th graders
    at a high school receiving a passing score on a standardized mathematics exam.

  3. \(\hat\beta_1 = 0.319\) means that if the percentage of students who are eligible for the lunch program is increased by one unit, then the percentage of tenth graders at a high school receiving a passing score on a standardized mathematics exam is expected to increase by 0.319, ceteris paribus.

LOG-LEVEL

data(meap93)
perf.logl <- lm(log(math10) ~ lnchprg, data = meap93)
summary(perf.logl)
## 
## Call:
## lm(formula = log(math10) ~ lnchprg, data = meap93)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.34067 -0.22219  0.03436  0.27521  1.29532 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  3.497277   0.046338   75.47   <2e-16 ***
## lnchprg     -0.016734   0.001618  -10.34   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4443 on 406 degrees of freedom
## Multiple R-squared:  0.2085, Adjusted R-squared:  0.2065 
## F-statistic: 106.9 on 1 and 406 DF,  p-value: < 2.2e-16
  1. The estimated regression equation:
    \(\widehat{log(math10)}=3.50 - 0.02\ lnchprg\)

  2. Report and Discuss all GOF.
    The RMSE is 0.44 which is near from 0, hence we say that it is a better fit.
    However, the \(R^2\) is 0.2085 which is far from 100 tells us that it is not a better fit.
    Hence, the model does not provide a good fit to the data.
    Moreover, lunch program explains about 20.85% of the variation in the log percentage of 10th graders at a high school receiving a passing score on a standardized mathematics exam.

  3. This tells us that an increase in the percentage of students who are eligible for the lunch program is predicted to decrease on the percentage of 10th graders at a high school receiving a passing score on a standardized mathematics exam by approximately 2%, ceteris paribus.

LEVEL-LOG

data(meap93)
perf.llog<- lm(math10 ~ log(lnchprg), data = meap93)
summary(perf.llog)
## 
## Call:
## lm(formula = math10 ~ log(lnchprg), data = meap93)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -23.336  -6.253  -1.417   4.724  46.218 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   45.6269     2.2732  20.072   <2e-16 ***
## log(lnchprg)  -7.0500     0.7287  -9.675   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.471 on 406 degrees of freedom
## Multiple R-squared:  0.1874, Adjusted R-squared:  0.1854 
## F-statistic:  93.6 on 1 and 406 DF,  p-value: < 2.2e-16
  1. The estimated regression equation:
    \(\widehat{math10}=45.63 - 7.05\ log(lnchprg)\)

  2. Report and Discuss all GOF.
    The RMSE is 9.47 which is far from 0, hence we say that it is not a better fit.
    However, the \(R^2\) is 0.1874 which is far from 100 tells us that it is not a better fit.
    Hence, the model does not provide a good fit to the data.
    Moreover, lunch program explains about 18.74% of the variation in the percentage of 10th graders
    at a high school receiving a passing score on a standardized mathematics exam.

  3. This tells us that an increase of 15% in the percentage of students who are eligible for the lunch program is predicted to decrease on the percentage of 10th graders at a high school receiving a passing score on a standardized mathematics exam by 1.05, ceteris paribus.

LOG-LOG

perf.loglog <- lm(log(math10) ~ log(lnchprg), data = meap93)
summary(perf.loglog)
## 
## Call:
## lm(formula = log(math10) ~ log(lnchprg), data = meap93)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.27639 -0.22457  0.03033  0.25315  1.29443 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.08338    0.10842  37.661   <2e-16 ***
## log(lnchprg) -0.33017    0.03476  -9.499   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4518 on 406 degrees of freedom
## Multiple R-squared:  0.1818, Adjusted R-squared:  0.1798 
## F-statistic: 90.24 on 1 and 406 DF,  p-value: < 2.2e-16
  1. The estimated regression equation:
    \(\widehat{log(math10)}=4.08 - 0.33\ \log(lnchprg)\)

  2. Report and Discuss all GOF.
    The RMSE is 0.44 which is near from 0, hence we say that it is a better fit.
    However, the \(R^2\) is 18.18 which is far from 100 tells us that it is not a better fit.
    Hence, the model does not provide a good fit to the data.
    Moreover, lunch program explains about 18.18% of the variation in the log percentage of 10th graders at a high school receiving a passing score on a standardized mathematics exam.

  3. This tells us that a 4% increase in the percentage of students who are eligible for the lunch program is predicted to decrease on the percentage of 10th graders at a high school receiving a passing score on a standardized mathematics exam by 1.32, ceteris paribus.

B

PLOT

plot(meap93$lnchprg, meap93$math10,
     col="black",
     pch=20,
     cex.main=1,
     ylab="Math10",
     xlab="Lnchprg")
abline(lm(math10 ~ lnchprg, data=meap93),
       col="red",
       lwd=2,)
text(x=50, y=20, "Level-level", col="red")
abline(lm(log(math10) ~ lnchprg, data = meap93),
       col="yellow",
       lwd=2)
text(x=40, y=5, "Log-level", col="yellow")
abline(lm(math10 ~ log(lnchprg), data = meap93),
       col="blue",
       lwd=2)
text(x=10, y=10, "Level-log", col="blue")
abline(lm(log(math10) ~ log(lnchprg), data = meap93),
       col="green",
       lwd=2)
text(x=5, y=6, "Log-log", col="green")