Question

5. Consider the following data (You are allowed to use built-in function in R, but the code must be attached) X 99.0 101.1 10

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

solution

Rcode:-

x=c(99,101.1,102.7,103.0,105.4,107,108.7,110.8,112.1,112.4,113.6,113.8,115.1,115.4,120)
y=c(28.8,27.9,27,25.2,22.8,21.5,20.9,19.6,17.1,18.9,16,16.7,13,13.6,10.8)
mean(x)
mean(y)
reg=lm(y~x);summary(reg)

plot(x,y)

output is

> mean(x)
[1] 109.34
> mean(y)
[1] 19.98667

Call:
lm(formula = y ~ x)

Residuals:
Min 1Q Median 3Q Max
-1.7754 -0.5727 -0.1325 0.6034 1.6818

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 118.90992 4.49912 26.43 1.10e-12 ***
x -0.90473 0.04109 -22.02 1.12e-11 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.938 on 13 degrees of freedom
Multiple R-squared: 0.9739, Adjusted R-squared: 0.9719
F-statistic: 484.8 on 1 and 13 DF, p-value: 1.125e-11

(a)

sample mean of y is 19.98667

sample mean of x is   109.34

the Sxx is 6.101499 and Sxy is

b) the equation of regression line is  

\widehat{Y}=118.9099-0.9047 X

c)O O O 20 100 105 110 115 120 X 15 25

d)the value of y at x=121 is 9.4369

e) SSE is 0.938

f)

#Residual Standard error (Like Standard Deviation)
k=length(reg$coefficients)-1;k #Subtract one to ignore intercept
SSE=sum(reg$residuals**2)
n=length(reg$residuals)
sqrt(SSE/(n-(1+k))) #Residual Standard Error

output is

> sqrt(SSE/(n-(1+k)))
[1] 0.9380352

g) coefficient of determination is 0.9739

Add a comment
Know the answer?
Add Answer to:
5. Consider the following data (You are allowed to use built-in function in R, but the...
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
  • No-fines concrete, made from a uniformly graded coarse aggregate and a cement-water paste, is beneficial in...

    No-fines concrete, made from a uniformly graded coarse aggregate and a cement-water paste, is beneficial in areas prone to excessive rainfall because of its excellent drainage properties. The article "Pavement Thickness Design for No- Fines Concrete Parking Lots," J. of Trans. Engr., 1995: 476-484) employed a least squares analysis in studying how y = porosity (%) is related to x = unit weight (pcf) in con- crete specimens. Consider the following representative data: x 99.0 101.1 102.7 103.0 105.4 107.0...

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