Description Usage Format References Examples
Egg data combined with data on nests
1 |
A data frame
Taxonomic family
Taxonomic order
Genus and species
Index of how asymmetric an egg is
Index of how elliptical an egg is
Mean length of egg
nest type of species
author
ellipticity of bird in grams
....
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | ## Not run:
library(ggplot2)
library(ggpubr)
## Explore data graphically
### Plot boxplots
ggpubr::ggboxplot(data = eggs_and_nests,
y = "ellipticity",
x = "nest",
fill = "nest")
### Plot histograms
ggpubr::gghistogram(data = eggs_and_nests,
x = "ellipticity",
title = "All data")
ggpubr::gghistogram(data = eggs_and_nests,
x = "ellipticity",
facet.by = "nest",
fill = "nest",
title = "Faceted by nest")
## End(Not run)
## Plot means with 95% confidence intervals
#ggpubr::ggerrorplot(eggs_and_nests,
# x = "nest",
# y = "ellipticity",
# desc_stat = "mean_ci",
# add = "mean")
## 1-way ANOVA
### null model
model.null <- lm(ellipticity ~ 1, data = eggs_and_nests)
### model of interest
model.alt <- lm(ellipticity ~ nest, data = eggs_and_nests)
### compare models
anova(model.null, model.alt)
## Pairwise comparisons after 1-way ANOVA
### no corrections for multiple comparisons
pairwise.t.test(x = eggs_and_nests$ellipticity, g = eggs_and_nests$nest,
p.adjust.method = "none")
### Bonferonni correction
pairwise.t.test(x = eggs_and_nests$ellipticity, g = eggs_and_nests$nest,
p.adjust.method = "bonferroni")
## Tukey test
### re-fit model with aov()
model.alt.aov <- aov(ellipticity ~ nest, data = eggs_and_nests)
### TukeyHSD() on model from aov()
TukeyHSD(model.alt.aov)
### Plot effect sizes
#plotTukeysHSD(TukeyHSD(model.alt.aov))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.