Question
Interpret R^2 (adjusted) for Equation 1, and indicate how this is possible given your above interpretations. use the below R console for the quesiton. >
Interpret R^2 (adjusted) for Equation 1, and indicate how this is possible given your above interpretations.
use the below R console for the quesiton.
> dim(ab.survey.csv)
[1] 1144 15
>
> sex2 <- rep(9,1144)
> sex2[sex=="Male"]<- 0
> sex2[sex=="Female"]<- 1
>
> table(sex)
sex
0 1
5 5
> table(sex2)
sex2
9
1144
>
> print(mean(sex2))
[1] 9
> print(mean(yrs.educ))
[1] 15.2736
> print(mean(age))
[1] 49.98951
>
> senior <- rep(9, 1144)
> senior [age < 65] <- 0
> senior [age >= 65] <- 1
> table (senior)
senior
0 1
927 217
>
> equation1 <- lm(yrs.educ ~ age + sex2)
> summary(equation1)
Call:
lm(formula = yrs.educ ~ age + sex2)
Residuals:
Min 1Q Median 3Q Max
-13.7684 -2.4257 -0.2163 2.0122 26.7266
Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.22539 0.33592 48.30 < 2e-16 ***
age -0.01904 0.00641 -2.970.00304 **
sex2 NA NA NA NA
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.408 on 1142 degrees of freedom
Multiple R-squared:0.007666, Adjusted R-squared: 0.006797
F-statistic: 8.822 on 1 and 1142 DF, p-value: 0.003039
>
> equation2 <- lm(yrs.educ ~ age + senior + sex2)
> summary(equation2)
Call:
lm(formula = yrs.educ ~ age + senior + sex2)
Residuals:
Min 1Q Median 3Q Max
-13.5664 -2.4600 -0.4083 2.4227 26.5753
Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 15.697180 0.408420 38.434 <2e-16 ***
age -0.005450 0.008771 -0.621 0.5345
senior -0.796690 0.351697 -2.265 0.0237 *
sex2 NA NA NA NA
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.402 on 1141 degrees of freedom
Multiple R-squared:0.01211, Adjusted R-squared: 0.01038
F-statistic: 6.993 on 2 and 1141 DF, p-value: 0.0009585
>
> print(num <- rnorm(1))
[1] 2.077669
> #End of R syntax.
>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started