library(tidyverse)
In this practical, we will explore our data in more detail using some basic statistical tests to identify where the variation in our data lies, and hence where the interesting ecological insights might lie. In this example dataset, we have d13C, d15N and C:N ratio from three fish species.
mydata <- read.csv("Practical02.csv", header = TRUE, stringsAsFactors = FALSE)
# force species to be a factor type variable
mydata$Species <- factor(mydata$Species)
# verify that it imported as expected
head(mydata)
NA
mydata %>% group_by(Species) %>%
summarise(count = n(),
mean_length = mean(Length),
mean_muscle_d13C = mean(Muscle.d13C),
mean_muscle_d15N = mean(Muscle.d15N),
mean_liver_d13C = mean(Liver.d13C),
mean_liver_d15N = mean(Liver.d15N))
NA
NA
NA
# code to do this using base R graphics
# plot(Liver.d13C ~ Liver.CN, data = mydata,
# subset = Species == "Arrowtooth.Flounder", main = "Arrowtooth.Flounder")
#
# # lowess smoother not working like this for the subset.
# # lines(lowess(mydata$Liver.CN, mydata$Liver.d13C), col = "red")
#
# plot(Liver.d13C ~ Liver.CN, data = mydata,
# subset = Species == "Pacific.cod", main = "Pacific.cod")
#
# plot(Liver.d13C ~ Liver.CN, data = mydata,
# subset = Species == "Pollock", main = "Pollock")
# try to do this in ggplot using facets
library(tidyverse)
liver.plot <- ggplot(data = mydata,
mapping = aes(x = Liver.CN,
y = Liver.d13C)) +
geom_point() +
geom_smooth(method = "loess", alpha = 0.5) +
facet_grid(Species~.) +
theme(text = element_text(size=20))
print(liver.plot)
The liver in particular has a large quantity of lipids, and in this example, we apply a simple numerical correction based on Logan et al 2008. This correction is weighted by the C/N ratio, such that high amounts of C require a greater correction.
See also Post et al 2007 for a good review of lipid correction.
This review by Kiljunen et al 2006 offers some suggestions too.
# constants used in the correction for liver tissue
a <- 6.059
b <- -22.270
c <- -1.397
# add columns for lipid corrected liver to the data.frame
mydata <- mydata %>%
mutate(Liver.d13C.crtd = Liver.d13C +
(a * Liver.CN + b) / (Liver.CN + c))
# mydata$Liver.d13C.crtd <- mydata$Liver.d13C +
# (a * mydata$Liver.CN + b) / (mydata$Liver.CN + c)
# check that it worked as expected
head(mydata)
# specify a color pallete with 3 colours for this example
# palette(c("black", "red", "blue"))
# plot the correlation between the corrected and raw values, and
# indicate which observations have large C/N ratios by the
# size of the datapoints.
# plot(Liver.d13C.crtd ~ Liver.d13C, data = mydata,
# col = Species, cex = 5 * Liver.CN / max(Liver.CN), pch = 19, asp = 1)
#
# # add the 1:1 line
# abline(a = 0, b = 1, col = "grey", lty = 1, lwd = 2)
#
#
# # reset the colour palette to the default
# palette("default")
# now plot the corrected values on top of our raw data from before
# and add a vertical line at 3.6 which is "pure protein"
liver.plot.2 <- liver.plot +
geom_point(data = mydata, aes(x = Liver.CN,
y = Liver.d13C.crtd),
col = "red") +
geom_vline(xintercept = 3.6, col = "black")
print(liver.plot.2)
ggsave(plot = liver.plot.2,
filename = "../../images/lipid_corrected_liver.jpg")
Saving 9 x 6 in image
As always, it is sensible to start by taking a quick look at the
summary statistics describing the data, and how the data are encoded in
R. The only bit of code I’ve changed here is to make the text of the
correlation coefficient text a bit smaller when defining the function
panel.cor()
.
# how are the data encoded in R?
str(mydata)
'data.frame': 113 obs. of 9 variables:
$ Species : Factor w/ 3 levels "Arrowtooth.Flounder",..: 1 1 1 1 1 1 1 1 1 1 ...
$ Length : int 320 170 180 360 160 500 420 350 370 480 ...
$ Muscle.d13C : num -19.1 -19.3 -19.3 -18.5 -19.5 ...
$ Muscle.d15N : num 15.3 13.3 12.8 15.3 13 ...
$ Muscle.CN : num 3.21 3.21 3.13 3.23 3.27 ...
$ Liver.d13C : num -22.5 -21.4 -22.2 -20.1 -22.6 ...
$ Liver.d15N : num 15.1 13 13.2 14.5 12.3 ...
$ Liver.CN : num 6.96 7.5 8.65 4.43 9.14 ...
$ Liver.d13C.crtd: num -18.9 -17.6 -18.1 -18.6 -18.4 ...
# a basic summary of each column in the data.frame
summary(mydata)
Species Length Muscle.d13C Muscle.d15N Muscle.CN
Arrowtooth.Flounder:29 Min. : 90 Min. :-23.41 Min. :12.49 Min. : 3.105
Pacific.cod :39 1st Qu.:270 1st Qu.:-19.75 1st Qu.:14.57 1st Qu.: 3.184
Pollock :45 Median :480 Median :-18.83 Median :16.03 Median : 3.235
Mean :450 Mean :-19.05 Mean :16.18 Mean : 3.901
3rd Qu.:620 3rd Qu.:-18.11 3rd Qu.:17.79 3rd Qu.: 3.327
Max. :820 Max. :-16.77 Max. :20.10 Max. :21.149
Liver.d13C Liver.d15N Liver.CN Liver.d13C.crtd
Min. :-28.48 Min. : 9.896 Min. : 3.225 Min. :-22.85
1st Qu.:-24.08 1st Qu.:13.336 1st Qu.: 6.395 1st Qu.:-19.03
Median :-22.71 Median :15.125 Median :10.189 Median :-18.41
Mean :-22.62 Mean :15.032 Mean :15.793 Mean :-18.62
3rd Qu.:-21.38 3rd Qu.:16.750 3rd Qu.:23.063 3rd Qu.:-17.92
Max. :-17.35 Max. :20.273 Max. :70.376 Max. :-16.23
# how many obverations do we have per Taxon might also be of use
table(mydata$Species)
Arrowtooth.Flounder Pacific.cod Pollock
29 39 45
# Using datq from our first practical, generate all pair-wise scatterplots
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# source("my_functions.R")
# These functions are copied from the help file for pairs()
## put histograms on the diagonal
panel.hist <- function(x, ...)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(usr[1:2], 0, 1.5) )
h <- hist(x, plot = FALSE)
breaks <- h$breaks; nB <- length(breaks)
y <- h$counts; y <- y/max(y)
rect(breaks[-nB], 0, breaks[-1], y, col = "cyan", ...)
}
panel.cor <- function(x, y, digits = 2, prefix = "", cex.cor, ...)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- cor(x, y)
txt <- format(c(r, 0.123456789), digits = digits)[1]
txt <- paste0(prefix, txt)
if(missing(cex.cor)) cex.cor <- 0.4/strwidth(txt)
# text(0.5, 0.5, txt, cex = cex.cor * r)
text(0.5, 0.5, txt, cex = 2)
}
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# this select function comes from the package dplyr and allows us to
# select a subset of columns to plot.
pairs(mydata,
diag.panel = panel.hist,
upper.panel = panel.smooth,
lower.panel = panel.cor)
NA
NA
NA
Using code from the first practical, we can use the package
dplyr
to generate summary statistics on the means and
variation of each species in the dataset. I summarise the muscle and
liver (using the lipid-corrected d13C) data separately only to keep the
resulting table smaller and nicer to print.
# Summarise the data by group using the package dplyr (install if required)
# load the library
library(tidyverse)
summarise.muscle <- mydata %>% group_by(Species) %>%
summarise(count = length(Species),
musC = mean(Muscle.d13C), musSdC = sd(Muscle.d13C),
musN = mean(Muscle.d15N), musSdN = sd(Muscle.d15N),
musCN = mean(Muscle.CN), musSdCN = sd(Muscle.CN))
# print a pretty table
knitr::kable(summarise.muscle, digits = 2)
Species | count | musC | musSdC | musN | musSdN | musCN | musSdCN |
---|---|---|---|---|---|---|---|
Arrowtooth.Flounder | 29 | -20.08 | 1.30 | 14.64 | 1.2 | 4.30 | 2.21 |
Pacific.cod | 39 | -18.07 | 1.07 | 17.98 | 1.0 | 3.78 | 2.41 |
Pollock | 45 | -19.23 | 1.12 | 15.60 | 1.7 | 3.75 | 2.82 |
# print(summarise.muscle)
summarise.liver <- mydata %>% group_by(Species) %>%
summarise(count = length(Species),
livC.c = mean(Liver.d13C.crtd),
livSdC.c = sd(Liver.d13C.crtd),
livN = mean(Liver.d15N),
livSdN = sd(Liver.d15N),
livCN = mean(Liver.CN),
livSdCN = sd(Liver.CN) )
# print a pretty table
knitr::kable(summarise.liver, digits = 2)
Species | count | livC.c | livSdC.c | livN | livSdN | livCN | livSdCN |
---|---|---|---|---|---|---|---|
Arrowtooth.Flounder | 29 | -18.66 | 0.70 | 14.21 | 1.34 | 8.38 | 3.79 |
Pacific.cod | 39 | -18.02 | 1.18 | 16.77 | 1.48 | 12.65 | 7.97 |
Pollock | 45 | -19.12 | 1.22 | 14.06 | 1.97 | 23.29 | 15.43 |
# print(summarise.liver)
The most suitable way to visualise the variation in the key tissues by species is probably to use simple boxplots. From here on in we will probably focus on the muscle data only and will put analysis of the liver samples on hold.
boxplot(Length ~ Species, data = mydata, col="grey",
xlab="Species", ylab="Length (cm)",
main = " variation in fish size")
boxplot(Muscle.d13C ~ Species, data = mydata, col="grey",
xlab="Species", ylab="Muscle d13C",
main = " variation in muscle d13C")
#now d15N
boxplot(Muscle.d15N ~ Species, data = mydata, col="grey",
xlab="Species", ylab="Muscle d15N",
main = " variation in muscle d15N")
#now d15N
boxplot(log(Muscle.CN) ~ Species, data = mydata, col="grey",
xlab="Species", ylab="log Muscle C/N",
main = " variation in muscle C/N")
NA
NA
An appropriate statistical test to determine whether the means of
these boxplots are significantly different from one another is a simple
ANOVA. You need to take a little care here, as the function you want
when analysing data is called aov()
in R (for Analysis of
Variance) whereas there is also a function anova()
but it
is used to compare fitted linear model objects (a discussion point for
another day, and one i wouldnt recommend in any case). I have
log-transformed the C/N data owing to the heavy skew evident in the
pairs plot above.
# length by species
length.aov <- aov(Length ~ Species, data = mydata)
summary(length.aov)
Df Sum Sq Mean Sq F value Pr(>F)
Species 2 572074 286037 7.872 0.000638 ***
Residuals 110 3996926 36336
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# muscle carbon by species
muscleC.aov <- aov(Muscle.d13C ~ Species, data = mydata)
summary(muscleC.aov)
Df Sum Sq Mean Sq F value Pr(>F)
Species 2 69.47 34.74 26.07 5.41e-10 ***
Residuals 110 146.57 1.33
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# muscle N by species
muscleN.aov <- aov(Muscle.d15N ~ Species, data = mydata)
summary(muscleN.aov)
Df Sum Sq Mean Sq F value Pr(>F)
Species 2 210.8 105.38 56.49 <2e-16 ***
Residuals 110 205.2 1.87
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# muscle C/N ratio by species
muscleCN.aov <- aov(log(Muscle.CN) ~ Species, data = mydata)
summary(muscleCN.aov)
Df Sum Sq Mean Sq F value Pr(>F)
Species 2 0.437 0.2184 2.044 0.134
Residuals 110 11.757 0.1069
Identifying which species are different from each other can be acheived using post-hoc tests that correct the p-values to take account of the multiple testing involved. Just looking at the d13C muscle data in this example (you can try the others as you like):
TukeyHSD(muscleC.aov)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = Muscle.d13C ~ Species, data = mydata)
$Species
diff lwr upr p adj
Pacific.cod-Arrowtooth.Flounder 2.0063584 1.3338843 2.6788325 0.0000000
Pollock-Arrowtooth.Flounder 0.8457546 0.1926797 1.4988296 0.0073897
Pollock-Pacific.cod -1.1606038 -1.7606068 -0.5606007 0.0000343
The larger Pacific Cod appears to be the largest of the fish on average, and they also have the larget d13C and d15N values. We might rightly want to know if this is due to their larger body size (length) or whether it is true species variation. We use analysis of covariance to investigate.
# specify a color pallete with 3 colours for this example
palette(c("black", "red", "blue"))
par(mfrow = c(1,2))
plot(Muscle.d13C ~ Length, col = mydata$Species, data = mydata,
main = "Muscle d13C")
legend("topleft", levels(mydata$Species), col = 1:3, pch = 1)
plot(Muscle.d15N ~ Length, col = mydata$Species, data = mydata,
main = "Muscle d15N")
legend("topleft", levels(mydata$Species), col = 1:3, pch = 1)
# reset the palette
palette("default")
d13C.length.model <- glm(Muscle.d13C ~ Species + Length, data = mydata)
summary(d13C.length.model)
Call:
glm(formula = Muscle.d13C ~ Species + Length, data = mydata)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.024e+01 2.867e-01 -70.593 < 2e-16 ***
SpeciesPacific.cod 1.927e+00 2.981e-01 6.464 2.96e-09 ***
SpeciesPollock 7.635e-01 2.913e-01 2.621 0.010 *
Length 4.975e-04 5.781e-04 0.861 0.391
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 1.335639)
Null deviance: 216.05 on 112 degrees of freedom
Residual deviance: 145.58 on 109 degrees of freedom
AIC: 359.31
Number of Fisher Scoring iterations: 2
d15N.length.model <- glm(Muscle.d15N ~ Species + Length, data = mydata)
summary(d15N.length.model)
Call:
glm(formula = Muscle.d15N ~ Species + Length, data = mydata)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.375e+01 3.152e-01 43.629 < 2e-16 ***
SpeciesPacific.cod 2.910e+00 3.277e-01 8.880 1.52e-14 ***
SpeciesPollock 5.111e-01 3.202e-01 1.596 0.113
Length 2.707e-03 6.354e-04 4.260 4.35e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 1.613847)
Null deviance: 415.96 on 112 degrees of freedom
Residual deviance: 175.91 on 109 degrees of freedom
AIC: 380.69
Number of Fisher Scoring iterations: 2
While d15N appears to scale positively with length (and you
can probably think why this might be), d13C does not appear to
be affected by length. You could assess this by comparing a model
without length
using AIC, where we are looking for AIC to
be lower by more than 2 units if we are to justify the inclusion of
length
in the model:
d13C.species.model <- glm(Muscle.d13C ~ Species, data = mydata)
summary(d13C.species.model)
Call:
glm(formula = Muscle.d13C ~ Species, data = mydata)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -20.0782 0.2144 -93.668 < 2e-16 ***
SpeciesPacific.cod 2.0064 0.2830 7.088 1.37e-10 ***
SpeciesPollock 0.8458 0.2749 3.077 0.00264 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 1.332492)
Null deviance: 216.05 on 112 degrees of freedom
Residual deviance: 146.57 on 110 degrees of freedom
AIC: 358.08
Number of Fisher Scoring iterations: 2
Based on this comparison, with an AIC of 359.31 for the model with length, and an AIC of 358.08 without length, we can conclude that length does not add sufficient explanatory information to warrant its inclusion.
Task: You might want to check whether there
is an interaction between species and length in this relationship.
Essentially this involves fitting 3 lines, one for each species by
length. You can add an interaction to the glm()
formulae,
using a :
to specify which variables interact.
We might well ask whether the isotope values are the same between the
liver and muscle tissues within the individual fish. To acheive this, we
can conduct a pair-wise t-test that adds power over a standard t-test by
treating the observations as being matched, or paired. Since we can’t
use the formula method (y~x
) easily when we have two
columns (vectors) of data to compare, we can’t use the
data = mydata
option, and so we have to use the
$
notation to provide the two vectors for comparison. We
can’t even use the subset =
option so instead we have to
subset each of our vectors manually:
mydata$Muscle.d13C[mydata$Species == "Arrowtooth.Flounder"]
.
You could take this code, copy it and modify it to run paired t-tests on the other species.
t.test(mydata$Muscle.d13C[mydata$Species == "Arrowtooth.Flounder"],
mydata$Liver.d13C.crtd[mydata$Species == "Arrowtooth.Flounder"],
paired = TRUE)
Paired t-test
data: mydata$Muscle.d13C[mydata$Species == "Arrowtooth.Flounder"] and mydata$Liver.d13C.crtd[mydata$Species == "Arrowtooth.Flounder"]
t = -6.1193, df = 28, p-value = 1.328e-06
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
-1.8971660 -0.9455698
sample estimates:
mean difference
-1.421368
Visualising the multivariate data is easiest if we add ellipses over each species group as we did in the first practical session. The code that follows is taken from there and modified accordingly to make sure the \(x\) and \(y\) data names are appropriate for this new dataset.
Now we can make a nice plot with ggplot
taking care to
change the aesthetics to make our column names if we just copied and
pasted this in from the first practical file.
# load the library
library(ggplot2)
# use our ellipse function to generate the ellipses for plotting
# this is the basic plot, which im not actually going to plot
# as i won't call print(first.plot). Doing this is purely choice,
# and for me it keeps my code tidier and easier to interpret
first.plot <- ggplot(data = mydata, aes(Muscle.d13C, Muscle.d15N)) +
geom_point(aes(color = Species), size = 2)+
ylab(expression(paste(delta^{15}, "N (\u2030)")))+
xlab(expression(paste(delta^{13}, "C (\u2030)"))) +
theme(text = element_text(size=15))
# decide how big an ellipse you want to draw
# NB 50% ellipses this time for no reason other than i dont need them huge
# to get a sense for their size and shape.. indeed we could plot
# Standard Ellipses using p.ell <- stats::pchisq(1, df = 2) which
# results in 0.39
p.ell <- 0.50
# create our plot based on first.plot above
# adding the stat_ellipse() geometry. We
# specify thee ellipse to be plotted using
# the polygon geom, with fill and edge colour
# defined by Taxon as a grouping variable,
# using the normal distribution and with
# a quite high level of transparency.
ellipse.plot <- first.plot +
stat_ellipse(aes(group = Species,
fill = Species,
color = Species),
alpha = 0.3,
level = p.ell,
type = "norm",
geom = "polygon")
print(ellipse.plot)
Analysing these data to test whether the means of both the d13C and
the d15N muscle data are simultaneously different can be achieved using
Multivariate Analysis of Variance (MANOVA) or PERMANOVA if you are not
happy with the assumptions of MANOVA, e.g. that the data are
multivariate normal and that they have similar (assumed the same)
covariance. In this case, both assumptions seem pretty reasonable to me
so I will go with MANOVA here in the first instance. Both models require
that we bind the two (or more) column vectors of data together into a
matrix which we can do using cbind()
. Remember that both
these methods take the subet =
option should you wish to
restrict your comparison to a subset of groups. A useful trick here
might be to use the match
function (which has an odd, but
nice to use alias %in%
) and in this example something like:
subset = (Species %in% c("Arrowtooth.Flounder", "Pacific.cod"))
could provide a useful template for you, especially should you wish to
restrict a larger dataset to only the fish or only the invertebrates if
they were all in the same dataset. Alternateively, you could create new
data.frames of only the data you want, and call them something helpful;
you could acheive this with the function
dplyr::filter()
multivar.model <- manova(cbind(Muscle.d13C, Muscle.d15N) ~ Species,
data = mydata)
summary(multivar.model)
Df Pillai approx F num Df den Df Pr(>F)
Species 2 0.53826 20.253 4 220 3.223e-14 ***
Residuals 110
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Running the PERMANOVA analysis requires the package
vegan
so you will need to
install.packages("vegan")
if you do not already have it.
The PERMANOVA method is a randomisation process that jumbles up the data
among the groups and determines how likely our observed data are given
random chance. It therefore does make the same parametric assumptions
about the data being multivariate normal distributed with a common
covariance structure among groups.
library(vegan)
Loading required package: permute
Loading required package: lattice
This is vegan 2.6-4
# extract the isotope data for muscle for
# subsequent modelling as a response variable.
Y_muscle <- with(mydata, cbind(Muscle.d13C, Muscle.d15N))
# run a PERMANOVA model
perm.model <- adonis(Y_muscle ~ Species,
data = mydata,
method = "euclidean",
permutations = 9999)
'adonis' will be deprecated: use 'adonis2' instead
# print output of the permanova model to screen
perm.model
$aov.tab
Permutation: free
Number of permutations: 9999
Terms added sequentially (first to last)
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
Species 2 280.23 140.117 43.815 0.4434 1e-04 ***
Residuals 110 351.77 3.198 0.5566
Total 112 632.01 1.0000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
$call
adonis(formula = Y_muscle ~ Species, data = mydata, permutations = 9999,
method = "euclidean")
$coefficients
Muscle.d13C Muscle.d15N
(Intercept) -19.1275254 16.075774
Species1 -0.9507043 -1.433802
Species2 1.0556540 1.909122
$coef.sites
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
(Intercept) 2.2112920 3.225277 3.594430 2.3431307 3.447602 2.1929641 4.604463 3.077721
Species1 -0.4354936 -1.218991 -1.298731 -0.2380668 -1.308016 -0.4890599 -1.188929 -1.058270
Species2 0.8097398 1.753388 1.825624 0.6118915 1.841941 0.8184829 1.428828 1.380654
[,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16]
(Intercept) 2.416565 2.2420300 3.527839 2.3261354 3.890486 2.4413395 2.3736789 2.4542954
Species1 -0.899593 -0.1522740 -1.315180 -0.8031789 -1.392215 -0.6389447 -0.8727169 -0.9143895
Species2 1.311190 0.3688225 1.845887 1.2235958 1.933181 0.9294482 1.2892458 1.3942408
[,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
(Intercept) 3.5648660 3.019525 2.1467578 2.813777 3.151090 2.582426 2.1338502 5.701113
Species1 -0.8498074 -1.167992 -0.2311889 -1.162602 -1.268019 -1.053592 -0.0221092 -1.574770
Species2 1.0411260 1.709965 0.5046340 1.655208 1.823049 1.563981 0.3081024 1.959693
[,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32]
(Intercept) 4.165332 3.0502992 2.1248683 2.2175117 2.558928 2.1713234 3.856272 2.3054058
Species1 -1.349394 -0.8523371 -0.1627724 0.5368699 -1.045505 0.3761792 1.680650 0.4333613
Species2 1.690149 1.0922002 0.4528871 -0.3764602 1.545954 -0.1665040 -2.100904 -0.2151684
[,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40]
(Intercept) 3.381312 2.503952 2.984993 2.988315 3.2486679 3.0249653 2.814777 3.518216
Species1 1.529008 1.123799 1.347233 1.479059 -0.4333812 -0.1261488 1.372316 1.642378
Species2 -1.847822 -1.174091 -1.554888 -1.738060 0.5542528 0.2086925 -1.562102 -2.025959
[,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48]
(Intercept) 3.376674 3.661618 3.929856 3.312646 3.781260 2.738860 2.2611185 3.128795
Species1 1.605497 1.633759 1.697143 1.520152 1.643212 1.072191 0.6679585 1.432981
Species2 -1.963804 -2.013278 -2.126162 -1.820874 -2.029886 -1.105843 -0.5475948 -1.691479
[,49] [,50] [,51] [,52] [,53] [,54] [,55] [,56]
(Intercept) 3.494790 2.660384 2.694016 2.848880 2.438866 2.8504225 3.148899 3.307871
Species1 1.639574 1.133447 1.301109 1.349200 1.033614 -0.1050097 1.402362 1.587746
Species2 -2.022856 -1.191600 -1.444188 -1.529478 -1.042101 0.2038187 -1.652184 -1.931880
[,57] [,58] [,59] [,60] [,61] [,62] [,63] [,64]
(Intercept) 2.748745 3.187172 2.978182 3.892004 2.834634 3.122780 2.1703058 2.475609
Species1 1.303158 1.563641 1.379390 1.689529 1.238568 1.417683 0.3259632 1.054986
Species2 -1.454729 -1.885556 -1.584722 -2.110125 -1.384287 -1.651453 -0.1462362 -1.078739
[,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72]
(Intercept) 3.382432 2.16891006 2.2543966 4.572611 2.6462900 2.660846 3.144552 2.44387320
Species1 1.510730 0.04535237 0.6780986 1.708902 -0.9288896 1.236472 -1.263321 0.36106377
Species2 -1.807505 0.24666574 -0.5743682 -2.157808 1.4512440 -1.340670 1.818225 -0.09773884
[,73] [,74] [,75] [,76] [,77] [,78] [,79] [,80]
(Intercept) 2.4878221 3.535965 2.696358 4.228241 2.2356447 2.524012 2.548105 2.1660669
Species1 -0.9679141 -1.378486 -1.113829 -1.479874 -0.3494665 1.119100 1.099861 0.3809518
Species2 1.4585209 1.948293 1.648749 2.013774 0.7256002 -1.167585 -1.145640 -0.1749111
[,81] [,82] [,83] [,84] [,85] [,86] [,87] [,88]
(Intercept) 2.1509423 4.2815027 3.2743299 3.049913 2.5717198 2.5091916 2.7027228 2.1691219
Species1 0.1440421 -0.8353348 -0.7312216 -1.208930 0.4044113 0.1082988 0.7675460 0.3893774
Species2 0.1240271 1.0102503 1.2275939 1.759692 -0.1490159 0.2256789 -0.7680896 -0.1845678
[,89] [,90] [,91] [,92] [,93] [,94] [,95] [,96]
(Intercept) 2.625288 2.6907288 3.542436 2.496103 2.5173434 2.5077849 2.960792 2.5197983
Species1 -1.042869 0.2004320 -1.355109 -0.992023 -0.6440124 -0.9793986 1.440673 0.9944691
Species2 1.569778 0.1149651 1.907333 1.456808 0.9235862 1.4223582 -1.675360 -1.0084336
[,97] [,98] [,99] [,100] [,101] [,102] [,103]
(Intercept) 2.1678365 2.1585923 2.14430991 2.3552588 2.2284237 2.760422 2.4454874
Species1 -0.4145890 -0.3573498 0.07906313 0.8723566 -0.4531954 -1.139586 0.8320207
Species2 0.7388283 0.7001109 0.19911787 -0.8281645 0.7550581 1.632260 -0.7477489
[,104] [,105] [,106] [,107] [,108] [,109] [,110] [,111]
(Intercept) 2.486382 2.1741794 2.730453 3.639233 3.009016 2.797642 3.394950 3.248333
Species1 1.055168 0.4065659 -1.136523 -1.386920 -1.227776 1.306605 1.545658 -1.310551
Species2 -1.066891 -0.2317323 1.671614 1.923190 1.736275 -1.465487 -1.871346 1.858994
[,112] [,113]
(Intercept) 2.801443 2.6718032
Species1 0.987435 -0.8577489
Species2 -1.049479 1.3723873
$f.perms
[,1]
[1,] 1.421360583
[2,] 0.452479773
[3,] 1.786540630
[4,] 0.518299206
[5,] 1.430423272
[6,] 2.710679963
[7,] 0.219151504
[8,] 2.312647653
[9,] 0.135114129
[10,] 1.027453749
[11,] 0.233306856
[12,] 0.744914552
[13,] 0.137879715
[14,] 1.061534538
[15,] 0.284680024
[16,] 0.625463424
[17,] 0.694834698
[18,] 0.883538028
[19,] 0.986894261
[20,] 5.744249438
[21,] 0.181503452
[22,] 1.589155772
[23,] 2.632267358
[24,] 2.126551595
[25,] 0.855725492
[26,] 1.730069375
[27,] 0.289975156
[28,] 0.914791967
[29,] 1.041686357
[30,] 0.741178624
[31,] 0.953846640
[32,] 0.602748065
[33,] 0.706680762
[34,] 1.298103608
[35,] 0.911042732
[36,] 0.975669493
[37,] 1.406584773
[38,] 0.760203588
[39,] 0.167650063
[40,] 0.229178178
[41,] 0.229321079
[42,] 1.038897025
[43,] 0.085794223
[44,] 1.866281711
[45,] 4.961009399
[46,] 2.052317516
[47,] 0.315144768
[48,] 0.265032506
[49,] 0.467467059
[50,] 0.404513105
[51,] 2.072053354
[52,] 3.267901655
[53,] 0.925687948
[54,] 0.607210759
[55,] 0.332278543
[56,] 2.181638896
[57,] 1.508057508
[58,] 2.647569104
[59,] 1.088408529
[60,] 3.060243369
[61,] 0.125626588
[62,] 1.153872931
[63,] 0.641995220
[64,] 0.079777967
[65,] 0.236111726
[66,] 1.052947137
[67,] 0.943557532
[68,] 2.803284632
[69,] 4.130110722
[70,] 0.129120356
[71,] 2.154563786
[72,] 0.078564308
[73,] 3.714299642
[74,] 0.860775852
[75,] 1.644892419
[76,] 0.415630923
[77,] 0.134585815
[78,] 0.713775529
[79,] 0.567308296
[80,] 1.563931465
[81,] 1.916786895
[82,] 0.656348676
[83,] 0.959666320
[84,] 3.279292502
[85,] 0.490453680
[86,] 0.688016837
[87,] 2.454801027
[88,] 1.384200644
[89,] 0.382468767
[90,] 2.152090002
[91,] 0.221353893
[92,] 0.852868522
[93,] 1.487953163
[94,] 2.556075844
[95,] 2.282428501
[96,] 2.613315674
[97,] 1.190931276
[98,] 0.082527797
[99,] 0.294589735
[100,] 0.449516014
[101,] 1.345858933
[102,] 0.408913807
[103,] 0.641819710
[104,] 1.058571835
[105,] 0.328438879
[106,] 0.883087678
[107,] 0.325477076
[108,] 2.089124577
[109,] 2.070208524
[110,] 0.558288135
[111,] 0.652978618
[112,] 0.669433727
[113,] 0.798770854
[114,] 3.614934237
[115,] 2.537048368
[116,] 0.682260943
[117,] 0.822952831
[118,] 1.555333451
[119,] 0.090635412
[120,] 0.193411825
[121,] 0.720895270
[122,] 0.573312584
[123,] 1.621837914
[124,] 0.479181305
[125,] 0.153377631
[126,] 0.105787437
[127,] 1.426094318
[128,] 1.170956193
[129,] 0.374072422
[130,] 0.672528663
[131,] 0.171632523
[132,] 0.604100310
[133,] 1.025151357
[134,] 0.193202261
[135,] 0.957046192
[136,] 0.999328222
[137,] 1.090549351
[138,] 0.700416534
[139,] 0.696222307
[140,] 0.062911922
[141,] 0.477141809
[142,] 1.318511528
[143,] 2.291369842
[144,] 1.071111554
[145,] 0.068653964
[146,] 0.282425620
[147,] 0.051426395
[148,] 1.270754381
[149,] 1.380764816
[150,] 1.934383311
[151,] 1.931536089
[152,] 0.547557717
[153,] 1.268799191
[154,] 0.451315466
[155,] 0.221314014
[156,] 0.310764858
[157,] 0.717423839
[158,] 0.293429202
[159,] 0.246533517
[160,] 1.328495680
[161,] 0.064939877
[162,] 0.693616728
[163,] 1.095302434
[164,] 0.837815902
[165,] 0.289083474
[166,] 2.752462053
[167,] 0.395516562
[168,] 1.175141838
[169,] 1.364323252
[170,] 0.330238379
[171,] 0.671776150
[172,] 0.511581536
[173,] 1.503406901
[174,] 0.656219438
[175,] 0.965280917
[176,] 0.577422403
[177,] 1.391013057
[178,] 0.406409706
[179,] 0.519188679
[180,] 2.324139754
[181,] 1.784213841
[182,] 0.833143405
[183,] 0.552449793
[184,] 1.226240464
[185,] 0.681109232
[186,] 1.147180597
[187,] 1.625802326
[188,] 0.268943677
[189,] 0.841061424
[190,] 1.546669102
[191,] 1.328410119
[192,] 0.304083164
[193,] 0.257456500
[194,] 0.813414353
[195,] 0.303068192
[196,] 0.332440874
[197,] 0.335563845
[198,] 0.383583027
[199,] 0.157637753
[200,] 1.204919727
[201,] 2.485787459
[202,] 0.797625136
[203,] 0.150142234
[204,] 0.567918150
[205,] 0.575503910
[206,] 0.728683384
[207,] 0.919264826
[208,] 0.432192602
[209,] 1.871777856
[210,] 1.222319238
[211,] 1.392986713
[212,] 1.075008754
[213,] 1.013174526
[214,] 3.635804549
[215,] 1.277006054
[216,] 0.416020696
[217,] 3.103068675
[218,] 0.685262959
[219,] 0.981418364
[220,] 1.107199247
[221,] 0.855468288
[222,] 1.236080062
[223,] 0.665785976
[224,] 0.965198998
[225,] 1.448504486
[226,] 0.211292958
[227,] 1.449659354
[228,] 0.354182363
[229,] 1.402310804
[230,] 0.189520803
[231,] 0.524869355
[232,] 0.792335224
[233,] 0.878568409
[234,] 1.642870883
[235,] 2.477098354
[236,] 0.209185005
[237,] 1.420818568
[238,] 2.605513316
[239,] 2.547411804
[240,] 0.114903103
[241,] 1.457146555
[242,] 0.211299158
[243,] 1.285382055
[244,] 2.259674137
[245,] 0.808700445
[246,] 1.387798018
[247,] 1.141157295
[248,] 1.655713443
[249,] 1.794279882
[250,] 1.930144545
[251,] 0.598858295
[252,] 0.731973343
[253,] 0.305637858
[254,] 1.895846519
[255,] 0.911487842
[256,] 0.924998706
[257,] 0.307463313
[258,] 0.868221328
[259,] 0.358148727
[260,] 3.518873663
[261,] 1.442070875
[262,] 2.132737434
[263,] 1.754758280
[264,] 0.719842299
[265,] 0.861200334
[266,] 0.697560222
[267,] 1.407660533
[268,] 1.843865768
[269,] 1.670895840
[270,] 1.542047954
[271,] 0.230041113
[272,] 0.120515948
[273,] 0.793705774
[274,] 1.372236407
[275,] 0.854007007
[276,] 0.038696136
[277,] 0.336066988
[278,] 1.346272784
[279,] 0.563270263
[280,] 1.609049830
[281,] 0.159962726
[282,] 2.186769363
[283,] 0.027934860
[284,] 0.359032439
[285,] 0.704015960
[286,] 0.340476028
[287,] 0.703463941
[288,] 0.192764990
[289,] 0.839349777
[290,] 0.199361604
[291,] 0.286651095
[292,] 1.829064245
[293,] 0.141437229
[294,] 0.091282136
[295,] 0.981312987
[296,] 1.550617737
[297,] 0.431078419
[298,] 0.252025026
[299,] 0.459154756
[300,] 0.364739743
[301,] 0.792018252
[302,] 0.658437780
[303,] 0.212897795
[304,] 1.694068973
[305,] 2.009984364
[306,] 1.952121183
[307,] 0.745010814
[308,] 0.189279815
[309,] 1.410888036
[310,] 0.785501218
[311,] 0.763738163
[312,] 1.278331260
[313,] 0.342657324
[314,] 0.422809606
[315,] 1.796618251
[316,] 2.868511592
[317,] 0.216569376
[318,] 0.428691261
[319,] 0.510966734
[320,] 1.846944354
[321,] 3.062128683
[322,] 0.941171063
[323,] 1.024751235
[324,] 1.156934072
[325,] 1.429546143
[326,] 1.679783454
[327,] 1.341896738
[328,] 0.645212325
[329,] 0.691945008
[330,] 0.676778324
[331,] 0.095582215
[332,] 0.747748760
[333,] 0.333746389
[334,] 0.684012241
[335,] 1.251908176
[336,] 1.430949447
[337,] 1.610326044
[338,] 0.340693338
[339,] 0.230427461
[340,] 0.520562719
[341,] 0.494339343
[342,] 1.605258571
[343,] 0.627834315
[344,] 1.143306100
[345,] 0.776542834
[346,] 1.641277707
[347,] 0.412656516
[348,] 0.509019185
[349,] 1.491580658
[350,] 0.902301642
[351,] 0.304869693
[352,] 0.246554813
[353,] 0.852067862
[354,] 0.655393581
[355,] 0.223502176
[356,] 0.221634793
[357,] 1.047728382
[358,] 1.346459394
[359,] 0.522093132
[360,] 2.575712996
[361,] 0.766233884
[362,] 0.306642495
[363,] 0.718640820
[364,] 2.139005859
[365,] 0.713836415
[366,] 1.347939898
[367,] 1.628311868
[368,] 1.023741640
[369,] 0.623288456
[370,] 0.336090019
[371,] 0.394435385
[372,] 0.681415812
[373,] 2.123941845
[374,] 2.361398653
[375,] 1.183404135
[376,] 0.463891400
[377,] 0.119248012
[378,] 1.768319473
[379,] 0.204766215
[380,] 0.669897287
[381,] 0.393280912
[382,] 2.282433910
[383,] 0.704780482
[384,] 0.410764224
[385,] 1.361433982
[386,] 1.165591282
[387,] 1.500598207
[388,] 0.773815598
[389,] 0.252915542
[390,] 0.895090334
[391,] 0.817943332
[392,] 1.260550054
[393,] 1.892354650
[394,] 0.332327480
[395,] 1.627600143
[396,] 0.649052132
[397,] 0.038348586
[398,] 0.175856516
[399,] 0.458681465
[400,] 0.691526935
[401,] 0.183355405
[402,] 1.760350270
[403,] 0.159095339
[404,] 0.049481021
[405,] 0.493544652
[406,] 1.572206040
[407,] 0.078983304
[408,] 0.243783530
[409,] 2.062553767
[410,] 0.609148882
[411,] 1.056463632
[412,] 0.267968489
[413,] 1.361003243
[414,] 0.765523559
[415,] 0.696073626
[416,] 0.368097333
[417,] 0.148326768
[418,] 0.361079824
[419,] 2.573254088
[420,] 2.951614080
[421,] 1.991996451
[422,] 0.744930442
[423,] 2.106542494
[424,] 2.176444012
[425,] 0.295333506
[426,] 0.234689131
[427,] 0.248660008
[428,] 1.990715173
[429,] 0.579940391
[430,] 2.144649064
[431,] 1.315487836
[432,] 0.184506642
[433,] 0.756133114
[434,] 0.547392988
[435,] 0.292156786
[436,] 0.366172810
[437,] 0.427382676
[438,] 0.510776219
[439,] 1.778124857
[440,] 0.063559308
[441,] 1.049396899
[442,] 0.075685552
[443,] 1.513585693
[444,] 1.462667530
[445,] 0.519162859
[446,] 1.380994829
[447,] 2.407452146
[448,] 1.211804392
[449,] 1.153817216
[450,] 0.247509027
[451,] 0.049356551
[452,] 0.815091693
[453,] 0.622800835
[454,] 2.194229094
[455,] 0.925672304
[456,] 1.972168852
[457,] 1.464244775
[458,] 1.143761723
[459,] 0.902427907
[460,] 0.427173112
[461,] 1.184059158
[462,] 1.149009746
[463,] 0.194400939
[464,] 1.013825858
[465,] 1.600806392
[466,] 0.463139452
[467,] 2.038494892
[468,] 2.313145983
[469,] 1.215682854
[470,] 1.055803142
[471,] 2.352617190
[472,] 0.616064151
[473,] 1.120622601
[474,] 0.385023210
[475,] 1.038175721
[476,] 1.470849442
[477,] 3.409921569
[478,] 0.255706830
[479,] 0.656772320
[480,] 0.350465989
[481,] 0.496838407
[482,] 0.922152555
[483,] 1.522371033
[484,] 0.639756705
[485,] 0.847522763
[486,] 0.249298261
[487,] 0.050886289
[488,] 2.365334250
[489,] 2.321406679
[490,] 1.933994269
[491,] 0.110810889
[492,] 1.392160250
[493,] 0.208388013
[494,] 0.548077083
[495,] 0.125837469
[496,] 0.417603078
[497,] 1.019447522
[498,] 0.468291810
[499,] 0.752011085
[500,] 0.623334396
[501,] 2.274087612
[502,] 1.576450752
[503,] 0.341177585
[504,] 1.511062078
[505,] 1.003245080
[506,] 0.128014020
[507,] 0.383582666
[508,] 0.330779509
[509,] 0.880070738
[510,] 0.399173206
[511,] 0.327035717
[512,] 1.374789219
[513,] 0.262642590
[514,] 0.379562096
[515,] 0.301289417
[516,] 1.646338663
[517,] 0.921986627
[518,] 0.922655992
[519,] 0.996707538
[520,] 0.141725026
[521,] 0.298629727
[522,] 3.982692504
[523,] 5.611743188
[524,] 1.931608559
[525,] 1.952199646
[526,] 0.749248345
[527,] 0.218241186
[528,] 0.736262943
[529,] 5.573968480
[530,] 4.112392754
[531,] 2.415280791
[532,] 1.299005016
[533,] 0.994031796
[534,] 0.414909789
[535,] 0.705020975
[536,] 0.311145290
[537,] 0.185874996
[538,] 0.859174642
[539,] 1.359902791
[540,] 0.736411312
[541,] 1.541755419
[542,] 1.632721330
[543,] 0.679990448
[544,] 2.488051446
[545,] 1.566768702
[546,] 0.450734967
[547,] 0.169539023
[548,] 0.449809835
[549,] 1.821827965
[550,] 0.424145861
[551,] 0.673004175
[552,] 0.820199535
[553,] 0.329503352
[554,] 0.555112354
[555,] 0.848927789
[556,] 1.726896348
[557,] 0.279362003
[558,] 0.538201182
[559,] 0.251034437
[560,] 0.748283835
[561,] 0.268649453
[562,] 2.754291789
[563,] 1.026308903
[564,] 0.614683954
[565,] 3.165664433
[566,] 0.530957851
[567,] 2.465410756
[568,] 0.189360346
[569,] 0.499197824
[570,] 0.575354591
[571,] 1.256526842
[572,] 1.825801375
[573,] 0.406075976
[574,] 0.795222638
[575,] 0.267792439
[576,] 0.703428457
[577,] 0.646416179
[578,] 0.248142975
[579,] 0.259658173
[580,] 0.792389383
[581,] 1.141920890
[582,] 0.078033078
[583,] 0.437693153
[584,] 0.614531957
[585,] 0.111236146
[586,] 0.925206983
[587,] 0.956119355
[588,] 0.446244722
[589,] 0.345310530
[590,] 0.419416402
[591,] 1.561419970
[592,] 1.108643622
[593,] 1.396429302
[594,] 0.842772019
[595,] 0.081558770
[596,] 0.205659288
[597,] 0.082596434
[598,] 0.455204595
[599,] 0.119466582
[600,] 6.523297987
[601,] 3.031827664
[602,] 0.899644957
[603,] 0.692928309
[604,] 0.107113497
[605,] 1.588746479
[606,] 1.806007673
[607,] 0.241345816
[608,] 2.223078094
[609,] 1.269537329
[610,] 0.369651390
[611,] 0.178753195
[612,] 1.489871814
[613,] 1.470444151
[614,] 0.989572405
[615,] 2.833117862
[616,] 0.192929960
[617,] 5.404391798
[618,] 1.476226003
[619,] 0.607029149
[620,] 0.317876734
[621,] 0.370635939
[622,] 0.089327929
[623,] 0.481140842
[624,] 0.458172565
[625,] 0.795815244
[626,] 0.471184159
[627,] 0.747789769
[628,] 0.528658590
[629,] 0.833960935
[630,] 0.289207722
[631,] 0.735162537
[632,] 2.185048978
[633,] 0.973745909
[634,] 4.355115889
[635,] 0.724777006
[636,] 1.324292338
[637,] 3.100831389
[638,] 0.228545808
[639,] 0.467336838
[640,] 0.821032284
[641,] 4.250254951
[642,] 2.897658895
[643,] 0.071765517
[644,] 0.893135864
[645,] 0.451910212
[646,] 1.216171959
[647,] 0.868742496
[648,] 3.562227243
[649,] 0.191374251
[650,] 0.602134515
[651,] 0.204916829
[652,] 0.107750500
[653,] 1.312055409
[654,] 0.738366033
[655,] 1.048861680
[656,] 1.155015557
[657,] 1.845791122
[658,] 0.135784683
[659,] 0.644101708
[660,] 0.720530956
[661,] 1.179906199
[662,] 1.153140120
[663,] 1.242202877
[664,] 1.494268773
[665,] 3.014885301
[666,] 1.268604571
[667,] 0.454970843
[668,] 0.724210532
[669,] 0.211564085
[670,] 0.273359188
[671,] 2.146739065
[672,] 0.231159142
[673,] 2.491627662
[674,] 0.211769746
[675,] 3.733702971
[676,] 1.889294638
[677,] 1.673934919
[678,] 0.853259871
[679,] 1.082058948
[680,] 1.292266466
[681,] 3.790654602
[682,] 0.585195442
[683,] 1.061561906
[684,] 5.260947493
[685,] 0.516896794
[686,] 0.534851998
[687,] 1.179977776
[688,] 0.412715162
[689,] 3.999507342
[690,] 0.169391056
[691,] 0.135447862
[692,] 0.336866669
[693,] 0.124047545
[694,] 0.162234361
[695,] 1.060786428
[696,] 2.321124427
[697,] 0.404771202
[698,] 0.700246646
[699,] 0.456837193
[700,] 2.415242545
[701,] 2.049979552
[702,] 0.838763053
[703,] 0.614029485
[704,] 0.493418642
[705,] 0.980622617
[706,] 0.933255532
[707,] 1.865018142
[708,] 0.355914980
[709,] 0.141249036
[710,] 1.045701378
[711,] 0.482762839
[712,] 0.562459567
[713,] 0.659530536
[714,] 0.093222971
[715,] 0.604094757
[716,] 1.103811166
[717,] 0.969624033
[718,] 0.183525192
[719,] 0.756842922
[720,] 0.340957241
[721,] 0.314355983
[722,] 0.392250052
[723,] 0.794688602
[724,] 0.414554962
[725,] 0.793858160
[726,] 0.344944045
[727,] 1.414946172
[728,] 0.465956636
[729,] 0.295689111
[730,] 1.854426749
[731,] 0.140011609
[732,] 2.449170842
[733,] 1.208977694
[734,] 0.583741626
[735,] 1.200864735
[736,] 0.347164438
[737,] 0.479196571
[738,] 0.881199925
[739,] 0.357974028
[740,] 2.570720778
[741,] 0.901707898
[742,] 1.025693061
[743,] 0.693594853
[744,] 0.722060000
[745,] 0.464756089
[746,] 1.270525648
[747,] 0.491467426
[748,] 1.975510096
[749,] 1.762675024
[750,] 0.904965051
[751,] 1.862318269
[752,] 0.464503069
[753,] 1.872476175
[754,] 0.306285414
[755,] 1.201493506
[756,] 0.105753698
[757,] 1.065473334
[758,] 1.191512104
[759,] 0.642030145
[760,] 1.359697522
[761,] 0.430530422
[762,] 0.543509275
[763,] 1.464125420
[764,] 1.468182752
[765,] 1.098165081
[766,] 0.436176105
[767,] 0.647223204
[768,] 2.560734343
[769,] 0.098512050
[770,] 0.545581162
[771,] 0.089007908
[772,] 2.988096677
[773,] 0.512826372
[774,] 0.352566972
[775,] 0.841924583
[776,] 0.570133494
[777,] 2.030825673
[778,] 2.079999741
[779,] 0.560875154
[780,] 1.054662429
[781,] 0.373098693
[782,] 3.823976947
[783,] 0.445641880
[784,] 0.498179391
[785,] 0.791196994
[786,] 2.619614299
[787,] 0.726399153
[788,] 0.929270711
[789,] 0.280314762
[790,] 0.658576766
[791,] 1.351722396
[792,] 0.821840251
[793,] 1.227230596
[794,] 0.567946582
[795,] 1.012475326
[796,] 0.336682570
[797,] 5.366908761
[798,] 0.664623749
[799,] 1.945962400
[800,] 1.644982465
[801,] 1.028848716
[802,] 0.376839011
[803,] 2.277458573
[804,] 1.545751157
[805,] 0.966992638
[806,] 1.179022988
[807,] 0.508423366
[808,] 1.220420318
[809,] 2.803056770
[810,] 6.597335797
[811,] 0.627591968
[812,] 1.681566593
[813,] 0.200955959
[814,] 0.096522248
[815,] 0.428731767
[816,] 2.552399509
[817,] 0.758162261
[818,] 0.314188422
[819,] 0.502633413
[820,] 2.571683911
[821,] 0.304993818
[822,] 1.833483290
[823,] 0.765498745
[824,] 1.239384336
[825,] 0.081137853
[826,] 1.192204359
[827,] 0.140890623
[828,] 3.223710804
[829,] 2.182817111
[830,] 0.667074307
[831,] 1.932653955
[832,] 0.317571006
[833,] 1.008431872
[834,] 0.168193992
[835,] 0.684717898
[836,] 3.136849759
[837,] 0.314278796
[838,] 1.573113254
[839,] 1.097163783
[840,] 0.163616519
[841,] 2.849695000
[842,] 0.917373790
[843,] 0.794205081
[844,] 1.396807618
[845,] 1.233575181
[846,] 1.179099329
[847,] 0.084463047
[848,] 0.460595890
[849,] 1.130399076
[850,] 0.216299091
[851,] 0.664971601
[852,] 0.231237187
[853,] 0.051098232
[854,] 0.467098526
[855,] 0.326984602
[856,] 0.143318542
[857,] 2.614573273
[858,] 0.829729816
[859,] 0.516801001
[860,] 1.456956872
[861,] 1.829428753
[862,] 0.430270385
[863,] 0.192754129
[864,] 0.150278012
[865,] 0.245791995
[866,] 2.945275697
[867,] 0.977491507
[868,] 1.498540581
[869,] 0.594160414
[870,] 0.536272759
[871,] 2.309829989
[872,] 0.165706282
[873,] 0.696377086
[874,] 0.857062895
[875,] 3.513450612
[876,] 2.539339517
[877,] 1.183506461
[878,] 0.122868287
[879,] 0.426240259
[880,] 0.340951933
[881,] 0.785042503
[882,] 1.018540566
[883,] 1.042864315
[884,] 0.930216227
[885,] 0.318965347
[886,] 1.427834312
[887,] 1.082889320
[888,] 0.122556828
[889,] 1.024189479
[890,] 3.380204300
[891,] 0.724580220
[892,] 1.030962504
[893,] 1.063835556
[894,] 1.652811598
[895,] 1.756081961
[896,] 0.494599637
[897,] 1.225938228
[898,] 1.560946920
[899,] 0.268833419
[900,] 1.105200560
[901,] 2.308894062
[902,] 0.815797647
[903,] 0.184643382
[904,] 0.759249158
[905,] 1.442388564
[906,] 0.597370318
[907,] 4.040858823
[908,] 0.397747121
[909,] 0.821662677
[910,] 1.061757625
[911,] 0.656898782
[912,] 0.289791658
[913,] 0.439094460
[914,] 2.641423678
[915,] 0.657009977
[916,] 0.375487346
[917,] 2.490942901
[918,] 1.181686404
[919,] 1.607057320
[920,] 0.584855311
[921,] 1.888631740
[922,] 0.556773432
[923,] 2.288335435
[924,] 0.475888779
[925,] 0.508884222
[926,] 5.352728596
[927,] 1.264617951
[928,] 2.495515100
[929,] 0.614794273
[930,] 1.075912362
[931,] 1.561264311
[932,] 0.277569662
[933,] 0.863456420
[934,] 2.214907756
[935,] 3.478690638
[936,] 0.719766366
[937,] 1.348739521
[938,] 2.795786629
[939,] 0.341732179
[940,] 0.516943777
[941,] 0.665732692
[942,] 3.677991914
[943,] 0.527397766
[944,] 0.682097995
[945,] 0.469763778
[946,] 1.371345478
[947,] 0.644273080
[948,] 0.212634228
[949,] 0.114290069
[950,] 0.615442520
[951,] 0.370160369
[952,] 0.205603799
[953,] 4.104031520
[954,] 2.055761132
[955,] 0.428210389
[956,] 0.684065248
[957,] 0.259196307
[958,] 0.597480225
[959,] 0.550460005
[960,] 0.368756529
[961,] 2.062106459
[962,] 0.247055398
[963,] 0.373237201
[964,] 1.002351769
[965,] 0.592037422
[966,] 0.221624762
[967,] 0.806199933
[968,] 2.374422005
[969,] 0.936834396
[970,] 3.125202327
[971,] 2.115599608
[972,] 0.798095050
[973,] 1.067341034
[974,] 2.130588842
[975,] 1.278131797
[976,] 1.032562559
[977,] 0.729945157
[978,] 0.160204404
[979,] 0.781420652
[980,] 1.021363452
[981,] 1.638306867
[982,] 0.660854590
[983,] 3.338623967
[984,] 1.790300589
[985,] 1.194736778
[986,] 0.749577669
[987,] 2.514506305
[988,] 0.464844302
[989,] 0.544215837
[990,] 0.389491545
[991,] 1.395919552
[992,] 0.676935611
[993,] 1.721737535
[994,] 0.096070567
[995,] 0.274032898
[996,] 0.557793688
[997,] 2.841838574
[998,] 1.102467711
[999,] 0.426296075
[1000,] 0.474108860
[ reached getOption("max.print") -- omitted 8999 rows ]
$model.matrix
(Intercept) Species1 Species2
1 1 1 0
2 1 1 0
3 1 1 0
4 1 1 0
5 1 1 0
6 1 1 0
7 1 1 0
8 1 1 0
9 1 1 0
10 1 1 0
11 1 1 0
12 1 1 0
13 1 1 0
14 1 1 0
15 1 1 0
16 1 1 0
17 1 1 0
18 1 1 0
19 1 1 0
20 1 1 0
21 1 1 0
22 1 1 0
23 1 1 0
24 1 1 0
25 1 1 0
26 1 1 0
27 1 1 0
28 1 1 0
29 1 1 0
30 1 0 1
31 1 0 1
32 1 0 1
33 1 0 1
34 1 0 1
35 1 0 1
36 1 0 1
37 1 0 1
38 1 0 1
39 1 0 1
40 1 0 1
41 1 0 1
42 1 0 1
43 1 0 1
44 1 0 1
45 1 0 1
46 1 0 1
47 1 0 1
48 1 0 1
49 1 0 1
50 1 0 1
51 1 0 1
52 1 0 1
53 1 0 1
54 1 0 1
55 1 0 1
56 1 0 1
57 1 0 1
58 1 0 1
59 1 0 1
60 1 0 1
61 1 0 1
62 1 0 1
63 1 0 1
64 1 0 1
65 1 0 1
66 1 0 1
67 1 0 1
68 1 0 1
69 1 -1 -1
70 1 -1 -1
71 1 -1 -1
72 1 -1 -1
73 1 -1 -1
74 1 -1 -1
75 1 -1 -1
76 1 -1 -1
77 1 -1 -1
78 1 -1 -1
79 1 -1 -1
80 1 -1 -1
81 1 -1 -1
82 1 -1 -1
83 1 -1 -1
84 1 -1 -1
85 1 -1 -1
86 1 -1 -1
87 1 -1 -1
88 1 -1 -1
89 1 -1 -1
90 1 -1 -1
91 1 -1 -1
92 1 -1 -1
93 1 -1 -1
94 1 -1 -1
95 1 -1 -1
96 1 -1 -1
97 1 -1 -1
98 1 -1 -1
99 1 -1 -1
100 1 -1 -1
101 1 -1 -1
102 1 -1 -1
103 1 -1 -1
104 1 -1 -1
105 1 -1 -1
106 1 -1 -1
107 1 -1 -1
108 1 -1 -1
109 1 -1 -1
110 1 -1 -1
111 1 -1 -1
112 1 -1 -1
113 1 -1 -1
$terms
Y_muscle ~ Species
attr(,"variables")
list(Y_muscle, Species)
attr(,"factors")
Species
Y_muscle 0
Species 1
attr(,"term.labels")
[1] "Species"
attr(,"order")
[1] 1
attr(,"intercept")
[1] 1
attr(,"response")
[1] 1
attr(,".Environment")
<environment: R_GlobalEnv>
attr(,"class")
[1] "adonis"
Some additional context we might like to add to this analysis is how
far apart the centroids are. The centroids of these ellipses are simply
the mean(d13C) and the mean(d15N) of each group, and we have already
calculated these for the graph above and the results held in the object
summarise.muscle
. We can then extract the two columns of
means, and use the dist()
function in R to calculate the
pairwise euclidean distances between them.
centroids <- cbind(summarise.muscle$musC, summarise.muscle$musN)
dist.btw.centoids <- dist(centroids)
print(dist.btw.centoids)
1 2
2 3.898797
3 1.278276 2.651899
# calculate the euclidean distances between observations
dis <- vegdist(Y_muscle,
method ="euclidean")
# analysis of multivariate homogeneity of
# group dispersions (variances)
mod <- betadisper(dis, mydata$Species)
# print the results of the ANOVA to screen
knitr::kable(anova(mod))
Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
---|---|---|---|---|---|
Groups | 2 | 7.336073 | 3.6680365 | 4.79097 | 0.0101156 |
Residuals | 110 | 84.217605 | 0.7656146 | NA | NA |
# perform Tukey's posthoc test between the means
mod.HSD <- TukeyHSD(mod)
# plot the post hoc test results
par(mfrow = c(1,1))
plot(mod.HSD)
As per the help files for ?capscale
and the related
?dbrda
, if we use Euclidean distances, as we do here, then
capscale
is identical to rda
with the latter
also being more efficient. Depending on the details of what one wants to
achieve with this analysis which has its origins in PRIMER, you may want
to explore more about these alternative functions.
# fit rda model from the vegan package
CAP_like_analysis <- vegan::rda( Y_muscle ~ Species,
data = mydata,
dist = "euclidean")
# try to predict a value for an "Arrowtooth.Flounder"
# for example.
predict(CAP_like_analysis,
newdata = data.frame(Species =
"Arrowtooth.Flounder"))
Muscle.d13C Muscle.d15N
1 -20.07823 14.64197
A quick plot of d13C against d15N to explore correlations in the muscle data for a question that came up in the session.
ggplot(data = mydata, mapping = aes(x = Muscle.d13C, Muscle.d15N))+
geom_point(aes(color = Species))