\[
%%
% Add your macros here; they'll be included in pdf and html output.
%%
\newcommand{\R}{\mathbb{R}} % reals
\newcommand{\E}{\mathbb{E}} % expectation
\renewcommand{\P}{\mathbb{P}} % probability
\DeclareMathOperator{\logit}{logit}
\DeclareMathOperator{\logistic}{logistic}
\DeclareMathOperator{\sd}{sd}
\DeclareMathOperator{\var}{var}
\DeclareMathOperator{\cov}{cov}
\DeclareMathOperator{\cor}{cor}
\DeclareMathOperator{\Normal}{Normal}
\DeclareMathOperator{\LogNormal}{logNormal}
\DeclareMathOperator{\Poisson}{Poisson}
\DeclareMathOperator{\Beta}{Beta}
\DeclareMathOperator{\Binom}{Binomial}
\DeclareMathOperator{\Gam}{Gamma}
\DeclareMathOperator{\Exp}{Exponential}
\DeclareMathOperator{\Cauchy}{Cauchy}
\DeclareMathOperator{\Unif}{Unif}
\DeclareMathOperator{\Dirichlet}{Dirichlet}
\DeclareMathOperator{\Wishart}{Wishart}
\DeclareMathOperator{\StudentsT}{StudentsT}
\DeclareMathOperator{\Weibull}{Weibull}
\newcommand{\given}{\;\vert\;}
\]
Homework 2: ANOVA
Assignment: Your task is to use Rmarkdown to write a short report. Your report may include visible R code, but should still be readable, as a narrative, with paragraphs describing methods, interpreting plots, and communicating results.
Please submit both the Rmd file and the resulting html or pdf file. You can work with other members of class, but I expect you to construct and run all of the scripts yourself.
The problem
You’ll be looking at the PanTHERIA dataset, which is
… a global species-level data set of key life-history, ecological and geographical traits of all known extant and recently extinct mammals (PanTHERIA) developed for a number of macroecological and macroevolutionary research projects.
Metadata is available at the Ecological Archives, and (along with some hints about how to load it appropriately) is included in this repository, here.
- The first question is: Does average adult body size differ significantly between trophic levels? By how much? For “body size” you should use the
AdultBodyMass_g
variable, and “trophic level” of a species, TrophicLevel
, is either herbivore, carnivore, or omnivore. In your report, you should
- summarize or plot adult body mass across the dataset
- transform to log10 body mass, and explain why this is a good idea
- show a plot of the distribution of log10 body mass by trophic level
- perform an ANOVA of log10 body mass against trophic level
- carefully explain the conclusion, including a short discussion of ways that this dataset violates the assumptions of ANOVA.
In your conclusion, consider that this is observational data, and furthermore, species share differing amounts of evolutionary history, making them highly nonindependent: bats (Order Chiroptera) are smaller than whales (Order Cetacea).