Respuesta :
Answer:
Step-by-step explanation:
a) image attached
b) Lets do the analysis in R , the complete R snippet is as follows
x<- c(89,177,189,354,362,442,965)
y<- c(.4,.6,.48,.66,.61,.69,.99)
# scatterplot
plot(x,y, col="red",pch=16)
# model
fit <- lm(y~x)
summary(fit)
#equation is
#y = 0.4041 + 0.0006211*X
# beta coeffiecients are
fit$coefficients
coef(summary(fit))[, "Std. Error"]
# confidence interval of slope
confint(fit, 'x', level=0.95)
The results are
> summary(fit)
Call:
lm(formula = y ~ x)
Residuals:
1 2 3 4 5 6 7
-0.05940 0.08595 -0.04151 0.03602 -0.01895 0.01136 -0.01346
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.041e-01 3.459e-02 11.684 8.07e-05 ***
x 6.211e-04 7.579e-05 8.195 0.00044 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.05405 on 5 degrees of freedom
Multiple R-squared: 0.9307, Adjusted R-squared: 0.9168 # model is able to capture 93% of the variation of the data
F-statistic: 67.15 on 1 and 5 DF, p-value: 0.0004403 , p value is less than 0.05 , hence model as a whole is significant
> fit$coefficients
(Intercept) x
0.4041237853 0.0006210758
> coef(summary(fit))[, "Std. Error"]
(Intercept) x
3.458905e-02 7.579156e-05
> confint(fit, 'x', level=0.95)
2.5 % 97.5 %
x 0.0004262474 0.0008159042
c)
> x=c(89,177,189,354,362,442,965)
> y=c(0.40,0.60,0.48,0.66,0.61,0.69,0.99)
>
> ### linear model
> model=lm(y~x)
> summary(model)
Call:
lm(formula = y ~ x)
Residuals:
1 2 3 4 5 6 7
-0.05940 0.08595 -0.04151 0.03602 -0.01895 0.01136 -0.01346
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.041e-01 3.459e-02 11.684 8.07e-05 ***
x 6.211e-04 7.579e-05 8.195 0.00044 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.05405 on 5 degrees of freedom
Multiple R-squared: 0.9307, Adjusted R-squared: 0.9168
F-statistic: 67.15 on 1 and 5 DF, p-value: 0.0004403
s_e is the Residual standard error from the model and its estimated value is 0.05405. s_e is the standard deviation of the model.
d) 95% confidence interval
> confint(model, confidence=0.95)
2.5 % 97.5 %
(Intercept) 0.3152097913 0.4930377793
x 0.0004262474 0.0008159042
Comment: The estimated confidence interval of slope of x does not include zero. Hence, x has the significant effect on y at 0.05 level of significance.
e)
> predict(model, newdata=data.frame(x=250), interval="confidence", level=0.95)
fit lwr upr
1 0.5593927 0.5020485 0.616737
f)
> predict.lm(model, newdata=data.frame(x=250), interval="prediction", level=0.95)
fit lwr upr
1 0.5593927 0.4090954 0.7096901
