Ruzaini Amiraa Roslan
9/18/2020
ToothGrowth
is loaded from R datasets
package.len
- The tooth length of the guinea pigssupp
- Supplement type, whether it is ascorbic acid (coded as VC
) or orange juice (coded as OJ
)dose
- Dosage amount in milligrams per daydata("ToothGrowth")
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
model <- lm(len ~ ., data = ToothGrowth)
summary(model)
##
## Call:
## lm(formula = len ~ ., data = ToothGrowth)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.085 -2.751 -0.800 2.446 9.650
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 12.4550 0.9883 12.603 < 2e-16 ***
## suppVC -3.7000 0.9883 -3.744 0.000429 ***
## dose1 9.1300 1.2104 7.543 4.38e-10 ***
## dose2 15.4950 1.2104 12.802 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.828 on 56 degrees of freedom
## Multiple R-squared: 0.7623, Adjusted R-squared: 0.7496
## F-statistic: 59.88 on 3 and 56 DF, p-value: < 2.2e-16