In: Statistics and Probability
Fenthion is a pesticide used against the olive fruit fly in olive groves. It is toxic to humans, so it is important that there be no residue left on the fruit or inolive oil that will be consumed. One theory was that, if there is residue of the pestice left in the olive oil, it would disspate over time. Chemists set out to test that theory by taking a random sample of small amounts of olive oil with fenthion residue and measuring the amount of fenthion in the oil at 3 different times over the year0day 0, day 281, and day 365.
SampleNumber | Group | Day | Fenthion | FenthionSulphoxide | FenthionSulphone | Time |
1 | 1 | 0 | 2.02 | 0 | 1.66 | 0 |
2 | 1 | 0 | 2.05 | 0 | 1.83 | 0 |
3 | 1 | 0 | 1.98 | 0 | 1.48 | 0 |
4 | 2 | 0 | 2.01 | 0 | 1.58 | 0 |
5 | 2 | 0 | 1.87 | 0 | 1.54 | 0 |
6 | 2 | 0 | 1.92 | 0 | 1.5 | 0 |
1 | 1 | 281 | 1.48 | 0.61 | 1.4 | 3 |
2 | 1 | 281 | 1.36 | 0.7 | 1.54 | 3 |
3 | 1 | 281 | 1.39 | 0.78 | 1.59 | 3 |
4 | 2 | 281 | 1.23 | 0.94 | 1.63 | 3 |
5 | 2 | 281 | 1.31 | 0.8 | 1.61 | 3 |
6 | 2 | 281 | 1.14 | 0.99 | 1.54 | 3 |
1 | 1 | 365 | 1.15 | 0.8 | 1.72 | 4 |
2 | 1 | 365 | 1.13 | 0.78 | 1.61 | 4 |
3 | 1 | 365 | 1.1 | 0.88 | 1.52 | 4 |
4 | 2 | 365 | 1.08 | 0.92 | 1.55 | 4 |
5 | 2 | 365 | 0.71 | 1.27 | 1.67 | 4 |
6 | 2 | 365 | 0.9 | 1.05 | 1.79 | 4 |
a. Two variables given in the data are fenthion and time. Which variable is the response variable and which variable is the explanatory variable? Explain.
b. Check the conditions necessary for conducting an ANOVA to analyze the amount of fenthion present in the samples. If the conditions are met, report the results of the analysis.
c. Transform the amount of fenthion using the exponential. Check the conditions necessary for conducting an ANOVA to analyze the exponential of the amount of fenthion present in the samples. If the conditions are met, report the results of the analysis
a. Time variable is the response variable and fenthion variable is the explanatory variable. Becauseusing time, we can measure the amounts of olive oil with fenthion.
b. This is the necessary conditions for applying an ANOVA. Each group sampleare drawn independently to each other and from a normally distributed population. All populations have a common variance.
x=read.csv("Book1.csv")
names(x)
Fenthion=x[,1]
Time=c(rep("z",6),rep("t",6), rep("f",6))
result=aov(Fenthion~Time)
summary(result)
summary(result)
Df Sum Sq Mean Sq F value Pr(>F)
Time 2 2.9065
1.4533 89.08 4.75e-09 ***
Residuals 15 0.2447
0.0163
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Condition
plot(result, 1) #Homogeneity of variances
library(car)
> leveneTest(Fenthion~Time)
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 2 0.6604 0.531
15
Warning message:
In leveneTest.default(y = y, group = group, ...) : group coerced to
factor.
From the output above we can see that the p-value is not less than the significance level of 0.05. This means that there is no evidence to suggest that the variance across groups is statistically significantly different. Therefore, we can assume the homogeneity of variances in the different treatment groups.
plot(result, 2) # Normality
> aov_residuals=residuals(object=result)
> shapiro.test(x = aov_residuals )
Shapiro-Wilk normality test
data: aov_residuals
W = 0.92931, p-value = 0.1889