eggs_and_nests: Egg data combined with data on nests

Description Usage Format References Examples

Description

Egg data combined with data on nests

Usage

1

Format

A data frame

family

Taxonomic family

order

Taxonomic order

spp

Genus and species

asymmetry

Index of how asymmetric an egg is

ellipticity

Index of how elliptical an egg is

ave.length.com

Mean length of egg

nest

nest type of species

source

author

bird.mass

ellipticity of bird in grams

References

....

Examples

 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))

brouwern/compbio4all documentation built on Dec. 19, 2021, 11:47 a.m.