Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You can download the data from faraway package in R program! 2. The data set chi

ID: 3054894 • Letter: Y

Question

You can download the data from faraway package in R program!

2. The data set chickwts contains the results of an experiment with a completely randomized design: 71 newly hatched chicks were randomly allocated into 6 groups, and each group was given a different feed supplement. You are to analyze how the weight (grams, after six weeks) of a chick depends on the feed that it was assigned. (d) Test whether there are any differences among the mean weights of the groups (based (e) Produce Tukey simultaneous 95% confidence intervals for all mean differences between (f) According to your Tukey intervals, which pairs of feeds have significantly different on an F-test at ? = 0.05). pairs of groups. means (after adjusting for multiple comparisons)? (List the pairs.)

Explanation / Answer

(d)

We will be conducting one-way anove test for the dataset chickwts. The code to be run in R-studio is given below.

# Create vectors of factors (6 levels) for feed
feed=factor(c(rep(1,10),rep(2,12),rep(3,14),rep(4,12),rep(5,11),rep(6,12)))

# Fit a regression model on chickwts data for different factors of weight and feed
model <- lm(chickwts$weight~feed)
# Run the anova test
anova(model)

The output of the anova is

> anova(model)
Analysis of Variance Table

Response: chickwts$weight
Df Sum Sq Mean Sq F value Pr(>F)
feed 5 231129 46226 15.365 0.0000000005936 ***
Residuals 65 195556 3009
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

As, the p-value of the F-test is less than the lpha, we reject the null hypothesis and conclude that atleast one of the mean weights of a group is significantly different than the other group.

(e)

We will be computing Tukey 95% confidence interval with the command TukeyHSD(aov(model)).

> TukeyHSD(aov(model))
Tukey multiple comparisons of means
95% family-wise confidence level

Fit: aov(formula = model)

$feed
diff lwr upr p adj
2-1 58.550000 -10.413543 127.51354 0.1413329
3-1 86.228571 19.541684 152.91546 0.0042167
4-1 168.716667 99.753124 237.68021 0.0000000
5-1 116.709091 46.335105 187.08308 0.0001062
6-1 163.383333 94.419790 232.34688 0.0000000
3-2 27.678571 -35.683721 91.04086 0.7932853
4-2 110.166667 44.412509 175.92082 0.0000884
5-2 58.159091 -9.072873 125.39106 0.1276965
6-2 104.833333 39.079175 170.58749 0.0002100
4-3 82.488095 19.125803 145.85039 0.0038845
5-3 30.480519 -34.414070 95.37511 0.7391356
6-3 77.154762 13.792470 140.51705 0.0083653
5-4 -52.007576 -119.239540 15.22439 0.2206962
6-4 -5.333333 -71.087491 60.42082 0.9998902
6-5 46.674242 -20.557722 113.90621 0.3324584

(f)

The pairs of feeds which are different for which the 95% confidence interval does not contain 0. The pairs are

3-1, 4-1, 5-1, 6-1, 4-2, 6-2, 4-3, 6-3,

or

soybean-horsebean,

sunflower-horsebean,

meatmeal-horsebean,

casein-horsebean,

sunflower-linseed,

casein-linseed,

sunflower-soybean,

casein-soybean,

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote