Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For this problem we w visit the teengamb dataset in the faraway R package: >1ibr

ID: 3050230 • Letter: F

Question

For this problem we w visit the teengamb dataset in the faraway R package: >1ibrary(faraay > data(teengamb) head (teengamb) sex status income verbal gamble 8 0.0 8 0.0 6 0.0 4 7.3 8 19.6 6 0.1 51 2.00 28 2.50 37 2.00 28 7.00 65 2.00 61 3.47 (a) Fit a univariate (multiple) linear regression model predicting a teenager's income from the additive effects of sex, status, and verbal. Interpret the results, e., which effects are significant at -0.1, and what is the direction/interpretation of the effects? Hint ?summary (b) Fit a univariate (multiple) linear regression model predicting a teenager's gambling expenses (gamble) from the additive effects of sex, status, and verbal. Interpret the results, ie., which effects are significant at -0.1, what is the direction interpretation of the effects. Hint: ?summary (c) Report the mean-squared errors (i.e., 2) for the models that you fit in Exercises la and 1b. Which model has a larger MSE? Can you think of a reason why this may be thease? Hint: ?teengamb

Explanation / Answer

R-code with out put

> sex=c(1,1,1,1,1,1)
> status=c(51,28,37,28,65,61)
> income=c(2.00,2.50,2.00,7.00,2.00,3.47)
> verbal=c(8,8,6,4,8,6)
> gamble=c(0.0,0.0,0.0,7.3,19.6,0.1)
> fit=lm(income~sex+status+verbal)
> fit

Call:
lm(formula = income ~ sex + status + verbal)

Coefficients:
(Intercept) sex status verbal  
10.26647 NA -0.01481 -0.96572  

> summary(fit)

Call:
lm(formula = income ~ sex + status + verbal)

Residuals:
1 2 3 4 5 6
0.21485 0.37412 -1.92400 1.01123 0.42225 -0.09845

Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)  
(Intercept) 10.26647 2.54766 4.030 0.0275 *
sex NA NA NA NA  
status -0.01481 0.03876 -0.382 0.7278  
verbal -0.96572 0.38770 -2.491 0.0884 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.304 on 3 degrees of freedom
Multiple R-squared: 0.736, Adjusted R-squared: 0.56
F-statistic: 4.182 on 2 and 3 DF, p-value: 0.1356

> Fit=lm(gamble~sex+status+verbal)
> Fit

Call:
lm(formula = gamble ~ sex + status + verbal)

Coefficients:
(Intercept) sex status verbal  
-2.8943 NA 0.2155 -0.3454  

> summary(Fit)

Call:
lm(formula = gamble ~ sex + status + verbal)

Residuals:
1 2 3 4 5 6
-5.3324 -0.3762 -3.0064 5.5422 11.2508 -8.0781

Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.8943 18.1990 -0.159 0.884
sex NA NA NA NA
status 0.2155 0.2769 0.778 0.493
verbal -0.3454 2.7695 -0.125 0.909

Residual standard error: 9.312 on 3 degrees of freedom
Multiple R-squared: 0.1766, Adjusted R-squared: -0.3724
F-statistic: 0.3217 on 2 and 3 DF, p-value: 0.7472

a)
Observe that variable status having p-value 0.7278 > alpha = 0.1 indicates that variable status is not significant.
Observe that variable verbal having p-value 0.0884 < alpha = 0.1 indicates that variable verbal is significant.

b)
Observe that variable status having p-value 0.493 > alpha = 0.1 indicates that variable status is not significant.
Observe that variable verbal having p-value 0.0.909 < alpha = 0.1 indicates that variable verbal is not significant.

c)

c)
The estimate of the standard error s is the square root of the MSE.
MSE = square of the standard error
Mean squared error for part-a is,
MSE = 1.304 *1.304 = 1.700416
Mean squared error for part-b is,
MSE = 9.312*9.312 = 86.71334
MSE for part b is larger.
MSE for part a is minimum therefore we prefer first model.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote