Question

In: Statistics and Probability

SOLVE USING R. COPY AND PASTE R INPUT AND OUTPUT. Fifteen turkey hens were randomly assigned...

SOLVE USING R. COPY AND PASTE R INPUT AND OUTPUT.

Fifteen turkey hens were randomly assigned to three groups of five. One group was given diet A, the second group diet B, and the third group diet C. We wish to know if there is a difference in the weight of eggs produced by the birds on these diets, and if so, which diet results in the largest eggs. The data are the mean weights of ten eggs from each bird. Check the normality and homogeneity assumptions first to see if you can use ANOVA.

Diet A 124 118 120 127 115

Diet B 98 100 95 102 105

Diet C 116 97 100 89 98

(a) Create a data frame called turkey where the first column is the Diet and the second column is the EggWeights.

(b) Test the normality assumption by running the Shapiro-Wilk Normality Test

   shapiro.test(turkey.mod$residuals)

Is the normality assumption violated? Explain.
(c) Test the homogeneity assumption by running the Bartlett Test

   bartlett.test(EggWeights ~ Diet, data=turkey)

Is the homogeneity assumption violated? Explain.

(d) Run an appropriate test (ANOVA or Kruskal-Wallis test, whichever is most appro- priate) to test your appropriate null hypothesis. (Note: make sure you explicitly state what the null hypothesis is before running your anova and make sure that you explicitly state your conclusions with explanation!).

Solutions

Expert Solution

(a)

R output:

Diet EggWeights
1 Diet_A 124
2 Diet_A 118
3 Diet_A 120
4 Diet_A 127
5 Diet_A 115
6 Diet_B 98
7 Diet_B 100
8 Diet_B 95
9 Diet_B 102
10 Diet_B 105
11 Diet_C 116
12 Diet_C 97
13 Diet_C 100
14 Diet_C 89
15 Diet_C 98
(b)

R output:
Shapiro-Wilk normality test

data: residuals
W = 0.93485, p-value = 0.322

Since p-value>0.05, normality assumption holds i.e. residuals are normally distributed.

(c) R code:

Bartlett test of homogeneity of variances

data: EggWeights by Diet
Bartlett's K-squared = 3.733, df = 2, p-value = 0.1547
Since p-value = 0.1547>0.05, assumption of equal variance holds.

(d)

From (b) and (c), we see that assumption of normality and equal variance hold, so we can use One way ANOVA to test H0.

One way ANOVA:

Df Sum Sq Mean Sq F value Pr(>F)
Diet 2 1442.1 721.1 16.06 0.000405 ***
Residuals 12 538.8 44.9   
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
p-value=0.0004<0.05, we reject H0 at 5% level of significance. Hence there is sufficient evidence to conclude that there is a significant difference in the weight of eggs produced by the birds on these diets.

R code:

Diet_A=c(124,118,120,127,115)
Diet_B=c(98,100,95,102,105)
Diet_C=c(116,97,100,89,98)
EggWeights= c(124,118,120,127,115,98,100,95,102,105,116,97,100,89,98)
Diet=c(rep("Diet_A",5), rep("Diet_B",5), rep("Diet_C",5))
turkey= data.frame(Diet,EggWeights)
turkey#(a)
model=lm(EggWeights ~ Diet, data=turkey)
residuals=resid(model)
shapiro.test(residuals)#(b)
bartlett.test(EggWeights ~ Diet, data=turkey)#(c)
anova_one_way <- aov(EggWeights ~ Diet, data=turkey)
summary(anova_one_way)#(d)


Related Solutions

SOLVE USING R: Eighteen freshwater mussels (Elliptio dilatata) were randomly assigned to three groups of six...
SOLVE USING R: Eighteen freshwater mussels (Elliptio dilatata) were randomly assigned to three groups of six each. One group was placed in water from the river where the mussels were collected, one group was placed in deionized water, and one group was placed in a solution of 0.5 millimoles per liter (mM) of sodium sulfate. At the end of a specified time period, blood (hemolymph) was collected from each mussel and potassium levels were determined. Do the treatments affect blood...
SOLVE USING R: Twenty four rug rats were randomly assigned to four groups of six each....
SOLVE USING R: Twenty four rug rats were randomly assigned to four groups of six each. The groups were subjected to different levels of stress (high, moderate, low, and none) induced by occasional, unexpected loud noises. After one week, density of blood lym- phocytes (cells ×106/ml) were measured. Prior studies indicated that the homogeneity assumption was violated and could not be remedied. High: 2.9, 1.8, 2.1, 1.5, 0.9, 2.8 Moderate: 3.7, 4.6, 4.2, 2.8, 3.2, 4.5 Low: 5.2, 6.2, 5.7,...
Fifteen people were randomly selected from the population and randomly assigned to 1 of 3 experimental...
Fifteen people were randomly selected from the population and randomly assigned to 1 of 3 experimental groups. Group 3 was included as the control group and did not receive any treatment. Use the following data set to answer the questions. Group 1 Group 2 Group 3 21 25 32 53 54 41 44 26 86 72 32 75 Is there a significant difference (α=0.05) between at least two groups?   A. Yes B. No C. Not possible to determine D. Alpha...
(Be sure to paste the R Console Output and code!!!) Using the following data and R,...
(Be sure to paste the R Console Output and code!!!) Using the following data and R, write a brief paragraph about whether the in-home treatment is equally effective as the out-of-home treatment for two separate groups. Here are the data. The outcome variable is level of anxiety after treatment on a scale from 1 to 10. In-Home Treatment Out-of-Home Treatment 3 7 4 6 1 7 1 8 1 7 3 6 3 5 6 6 5 4 1 2...
These problems may be solved using Minitab. Copy and paste the appropriate Minitab output into a...
These problems may be solved using Minitab. Copy and paste the appropriate Minitab output into a word-processed file. Add your explanations of the output near the Minitab output. DO NOT SIMPLY ATTACH PAGES OF OUTPUT AS AN APPENDIX. Each problem should be able to fit on one or two pages, and each problem should include the following: Minitab output for the ANOVA. Written statement interpreting the ANOVA. Four-in-one plot of the residuals. Written interpretation as to whether the three assumptions...
No Copy Paste, No Handwritten Here are the 2 questions. Pl, solve these using the data...
No Copy Paste, No Handwritten Here are the 2 questions. Pl, solve these using the data given below. The explanation should be very clear and each step has to be shown. Operating costs (excl. depreciations & amortization): $4.5m Depreciation and amortization: $1.5m Interest: $0.7m Net Income: $2.8m Tax Rate: 35% 1 Find out the EBITDA 2 calculate the sales level which would give a net income of $4.2million for the following year, given that operating costs (given above) will get...
PLEASE SOLVE USING RSTUDIO 1. Eighteen freshwater clams were randomly assigned to 3 groups of 6...
PLEASE SOLVE USING RSTUDIO 1. Eighteen freshwater clams were randomly assigned to 3 groups of 6 each. One group was placed in the pond water from which the clams were collected, one group was placed in deionized water, and one group was placed in a solution of 0.5 mM sodium sulfate. At the end of the specified time period, blood potassium levels were determined. i. Consider and comment on the technical assumptions of ANOVA. Conduct statistical tests where possible and...
R studio questions Write up your answers and paste the R code Copy and paste all...
R studio questions Write up your answers and paste the R code Copy and paste all plots generated. First create a sample drawn from a normal random variable. R has many distributions for which you can get probabilities and draw random numbers. We are going to use the normal. Go to help in R and type in rnorm. You will see a write up for functions associated with the normal distribution. dnorm is the density; pnorm is the probability distribution...
Using R Studio Use the two iid samples. (You can copy and paste the code into...
Using R Studio Use the two iid samples. (You can copy and paste the code into R). They both come from the same normal distribution. X = c(-0.06, 1.930, 0.608 -0.133,0.657, -1.284, 0.166, 0.963, 0.719, -0.896) Y = c(0.396, 0.687, 0.809, 0.939, -0.381, -0.042, -1.529, -0.543, 0.758, -2.574, -0.160, -0.713, 0.311, -0.515, -2.332, -0.844, -0.942, 0.053, 0.066, 0.942, -0.861, -0.186, -0.947, -0.110, 0.634, 2.357, 0.201, -0.428, -1.661, 0.395) (a) Report 95% confidence interval for the mean of X. Should we...
Part 2– R work (must be done in R) Copy and paste your R code and...
Part 2– R work (must be done in R) Copy and paste your R code and output into a word document, along with your written answers to the questions, and upload to Canvas.   Follow these instructions to import the necessary dataset: Before opening the dataset needed for this problem, you’ll need to call the “car”package.  Run the following line of code: > library(car) Now you can import the “Prestige” dataset and use it to answer the question below. Name the data...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT