Problem 1:
You will need to download from blackboard the dataset
“OneWayAnovaR.csv.” Workers at a tree farm decided to test the efficacy
of three fertilizer mixtures (A, B, and C) on the growth of Norway maple
seedlings, Acer platanoides. The table below contains the heights of
seedlings (in feet) for the three fertilizer treatments. Conduct an
ANOVA to determine if there are significant differences in the heights
among the three treatments. Use the Tukey test (“TukeyHSD” function) for
all pairwise comparisons. Explain the results. Hint: for the Tukey test
you will also have to fit the model using the “aov” function.
The one way ANOVA test has a p-value of 0.0207 < 0.05. The
p-value represents the chance of the null hypothesis (or something more
extreme) being true by chance in your observations. Therefore, we reject
the null hypothesis that the mean height is the same no matter which of
the three fertilizers is used and find that at least one sample mean
(not sure which) is different from the other means.
TukeyHSD(oneway, conf.level = 0.95)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = height ~ fertilizer, data = sapling)
##
## $fertilizer
## diff lwr upr p adj
## B-A -0.79 -1.5174524 -0.062547632 0.0312690
## C-A -0.73 -1.4574524 -0.002547632 0.0490741
## C-B 0.06 -0.6674524 0.787452368 0.9772281
The p-values are statistically significant (< 0.05) for the
pairwise tests between fertilizers B-A and C-A. This is also supported
by the confidence intervals for those two pairings, because they do not
contain 0.
Problem 2:
You will need to download from blackboard the dataset
“TwoWayAnovaR.csv.” This dataset contains data on the enzyme activity
(the response variable) of mannose-6-phosphate isomerase (MPI) for three
different genotypes (SS, FS, FF) in the amphipod crustacean
Platorchestia platensis. Specimens were classified by sex to also
examine the effects of gender on enzyme activity. Conduct a two-way
ANOVA. You will need to obtain p-values for genotype, sex and the
interaction between genotype and sex (See page 374 in book). Explain the
results.
mpi = read_excel("/Users/The-Queen/Documents/Biometry/Homework_Stuff/HW_5/TwoWayAnovaR.xlsx")
twoway = aov(Enzyme ~ Gentoype + Sex + (Gentoype * Sex),data = mpi)
summary(twoway)
## Df Sum Sq Mean Sq F value Pr(>F)
## Gentoype 2 13.187 6.594 33.926 1.01e-07 ***
## Sex 1 0.069 0.069 0.356 0.557
## Gentoype:Sex 2 0.109 0.054 0.279 0.759
## Residuals 24 4.664 0.194
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
P-values are as follows: Genotype = 1.01e-7 (<0.05); Sex = 0.557
(>0.05); Genotype-Sex Interaction = 0.759 (>0.05)
The only variable that was found to have a significant effect on
enzyme activity was genotype. Neither Sex nor the interaction between
Sex and Genotype had a significant effect on enzyme activity.
Problem 3:
You will need to download from blackboard the dataset “AncovaR.csv.”
This dataset contains some of the gecko data that I presented in the
ANCOVA section in class. The variables included are log transformed body
size (logBODYL, the covariate), log transformed head length (logHL, the
dependent variable), and sex (Sex, the independent variable). The idea
is to statistically test for differences in head length between males
and females while controlling for the effects overall size of the
individuals…Conduct and ANCOVA on the gecko dataset and explain the
results.
gecko = read_excel("/Users/The-Queen/Documents/Biometry/Homework_Stuff/HW_5/AncovaR.xlsx")
geck <- aov(logHL ~ Sex + logBODYL, data = gecko)
Anova(geck, type = "III")
## Anova Table (Type III tests)
##
## Response: logHL
## Sum Sq Df F value Pr(>F)
## (Intercept) 0.000130 1 0.0534 0.81858
## Sex 0.016463 1 6.7832 0.01317 *
## logBODYL 0.191863 1 79.0528 1.02e-10 ***
## Residuals 0.089800 37
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
When controlling for overall body size of geckos, both sex and body
length were still found to have a significant effect on head
length.