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
=118.9099-0.9047 X
c)
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
5. Consider the following data (You are allowed to use built-in function in R, but the...
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...