In: Statistics and Probability
question 1
In the datasets package, there is a dataframe ChickWeight. The weights of the chicks are recorded in gram and the variable time is measured in days. Run a regression model to show how the passage of time influences the weight of the chicks. Based on the regression results, which of the following are true?(choose all correct)
a.The chicks weigh about 27 grams when they hatch.
b.We accept the null hypothesis that time has no effect on the weight of the chicks.
c.The chicks gain about 8.8 grams per day.
d.We can reject the null hypothesis that time has no effect on the weight of the chicks.
Sol:
Rcode:
attach(ChickWeight)
mod =lm(weight ~Time,data = ChickWeight)
summary(mod)
output:
attach(ChickWeight)
mod =lm(weight ~Time,data = ChickWeight)
summary(mod)
Call:
lm(formula = weight ~ Time, data = ChickWeight)
Residuals:
Min 1Q Median 3Q Max
-138.331 -14.536 0.926 13.533 160.669
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 27.4674 3.0365 9.046 <2e-16 ***
Time 8.8030 0.2397 36.725 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 38.91 on 576 degrees of freedom
Multiple R-squared: 0.7007, Adjusted R-squared:
0.7002
F-statistic: 1349 on 1 and 576 DF, p-value: < 2.2e-16
SLope=8.8
weight /time=8.8
For unit increase in day ,chick increases by 8.8
F(1,576)=1349
p= 2.2e-16
p<0.05
Reject H0
Accept Ha
MARK
OPTION C
and Option D
c.The chicks gain about 8.8 grams per day.
d.We can reject the null hypothesis that time has no effect on the weight of the chicks.