Question

DATA 2 ID X1 X2 X3 Y A 0 2 4 9 B 1 0 8...

DATA 2

ID X1 X2 X3 Y
A 0 2 4 9
B 1 0 8 10
C 0 1 0 5
D 1 1 0 1
E 0 0 8 10

CORRELATION MATRIX

Y X1 X2 X3
Y 1 ? -0.304 +0.889
X1 ? 1 -0.327 0
X2 -0.304 -0.327 1 -0.598
X3 +0.889 0 -0.598 1

1. What is the mean squared error of the full model? (Correct answer is 4, please show me how to get there)

2.What is the typical deviation when you use the full model to predict scores on Y in the sample? (Correct answer is 0.89, please show me how to get there)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

R code and output

y=c(9,10,5,1,10)
x1=c(0,1,0,1,0)
x2=c(2,0,1,1,0)
x3=c(4,8,0,0,8)
x=rbind(y,x1,x2,x3)
cor(t(x))
y x1 x2 x3
y 1.0000000 -0.3478042 -0.3035884 0.8890009
x1 -0.3478042 1.0000000 -0.3273268 0.0000000
x2 -0.3035884 -0.3273268 1.0000000 -0.5976143
x3 0.8890009 0.0000000 -0.5976143 1.0000000
fit=lm(y~x1+x2+x3)
summary(fit)

Call:
lm(formula = y ~ x1 + x2 + x3)

Residuals:
1 2 3 4 5
-1.49e-16 1.00e+00 1.00e+00 -1.00e+00 -1.00e+00

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.0000 2.8868 1.039 0.488
x1 -2.0000 2.0000 -1.000 0.500
x2 1.0000 1.6330 0.612 0.650
x3 1.0000 0.3227 3.098 0.199

Residual standard error: 2 on 1 degrees of freedom
Multiple R-squared: 0.9355, Adjusted R-squared: 0.7419
F-statistic: 4.833 on 3 and 1 DF, p-value: 0.3199

anova(fit)
Analysis of Variance Table

Response: y
Df Sum Sq Mean Sq F value Pr(>F)
x1 1 7.5 7.5 1.875 0.4016
x2 1 12.1 12.1 3.025 0.3322
x3 1 38.4 38.4 9.600 0.1987
Residuals 1 4.0 4.0   
y1=3-2*x1+x2+x3
y1
[1] 9 9 4 2 11

Add a comment
Know the answer?
Add Answer to:
DATA 2 ID X1 X2 X3 Y A 0 2 4 9 B 1 0 8...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT