In: Statistics and Probability
SUBMIT ASSOCIATED R SCRIPT WITH THIS ASSIGNMENT
1. There have been several reports that house plants grow at different rates if they are exposed to music. To test this idea, you obtained 30 plants, and randomly chose 10 of plants each for exposure to rock music, exposure to classical music, and a control (no music). Several plants died over the course of the experiment. Below are heights of each plant after the 10 weeks (in cm). Run an Fmax test, Bartlett's test, and a Levene’s test on the data and fill in the cells below.
control | rock music | classical |
9.6 |
9 | 6.9 |
7.2 | 7.8 | 9.7 |
8.9 | 8.1 | 6.1 |
12.6 | 5.6 | 8.8 |
6.1 | 6.4 | 10.6 |
6.9 | 8.2 | 7.9 |
13.8 | 7.8 | 10.4 |
12.9 | 9.9 | 11 |
7.3 | 7.4 | |
13.1 |
a.What are your null and alterative hypotheses for each test?
Fmax:
H0
HA:
Bartlett's:
H0:
HA:
Levene's
H0:
HA:
b. Fmax
i. What are your critical and calculated values?
critical:
calculated:
ii. What is your conclusion? Do you need to transform your data? If you needed to transform your data, what tranformation did you use? What is your new calculated value?
2. You run the experiment again and this time, no plants die.
control | rock music | classical |
8.9 | 8.8 | 6.4 |
6.9 | 6.9 | 10.1 |
9.2 | 7.9 | 5.9 |
12.4 | 6.3 | 9.2 |
7.1 | 6.2 | 11 |
5.9 | 8.3 | 8.1 |
14.2 | 8.4 | 9.9 |
13.1 | 11.6 | 11.2 |
6.8 | 10.1 | 6.4 |
12.8 | 9.8 | 8.3 |
a. Bartlett's test
i. what is your p-value
ii. what is your conclusion? Do you need to transform your data?
iii. If you needed to transform your data, what transformation did you use? What's your new p-value?
b. Levene's test
i. what's your p-value before transformation?
ii. what's your p-value after transformation (if you needed it)? If the data don't need a transformation explain why.
> library(PMCMRplus)
>
> control=c(9.6,7.2,8.9,12.6,6.1,6.9,13.8,12.9,7.3,13.1)
> rock_music=c(9,7.8,8.1,5.6,6.4,8.2,7.8,9.9)
> classical=c(6.9,9.7,6.1,8.8,10.6,7.9,10.4,11,7.4)
>
> Y=c(9.6,7.2,8.9,12.6,6.1,6.9,13.8,12.9,7.3,13.1,
+ 9,7.8,8.1,5.6,6.4,8.2,7.8,9.9,
+ 6.9,9.7,6.1,8.8,10.6,7.9,10.4,11,7.4)
>
> Rate=c(rep("control",10), rep("rock_music",8),
rep("classical",9))
> data=data.frame(Y, Rate)
> hartleyTest(Y ~ Rate, data=data)
Hartley's maximum F-ratio test of homogeneity of variances
data: Y by Rate
F Max = 4.8481, df = 7, k = 3, p-value = 0.1258
Warning message:
In hartleyTest.default(c(9.6, 7.2, 8.9, 12.6, 6.1, 6.9, 13.8, 12.9,
:
Maximum F-ratio test is imprecise for unbalanced designs.
>
>
> par(mfrow=c(2,2))
> qqnorm(control)
> qqline(control)
> qqnorm(rock_music)
> qqline(rock_music)
> qqnorm(classical)
> qqline(classical)
>
> X=sqrt(control)
> Y=log(rock_music)
> Z=log(classical)
>
>
>
> par(mfrow=c(2,2))
> qqnorm(X)
> qqline(X)
> qqnorm(Y)
> qqline(Y)
> qqnorm(classical)
> qqline(classical)