library(readxl) #for reading in datalibrary(dplyr) #used for summary statslibrary(plotrix) #for std error
Attaching package: 'plotrix'
The following object is masked from 'package:datawizard':
rescale
library(cowplot) #used for plot themes
Attaching package: 'cowplot'
The following object is masked from 'package:lubridate':
stamp
library(GGally) #used for plots
Registered S3 method overwritten by 'GGally':
method from
+.gg ggplot2
library(ggtext) #fontslibrary(performance) #used to check modellibrary(car) #used to perform stat test
Loading required package: carData
Attaching package: 'car'
The following object is masked from 'package:dplyr':
recode
The following object is masked from 'package:purrr':
some
library(report) #used to report test resultslibrary(emmeans) #to calc emmeans and perform post hoc test
Attaching package: 'emmeans'
The following object is masked from 'package:GGally':
pigs
library(multcomp) #post hoc testing
Loading required package: mvtnorm
Attaching package: 'mvtnorm'
The following object is masked from 'package:modelbased':
standardize
The following object is masked from 'package:effectsize':
standardize
The following object is masked from 'package:datawizard':
standardize
Loading required package: survival
Loading required package: TH.data
Loading required package: MASS
Attaching package: 'MASS'
The following object is masked from 'package:dplyr':
select
Attaching package: 'TH.data'
The following object is masked from 'package:MASS':
geyser
library(broom) #tidy functionlibrary(ggpattern)library(MuMIn) #for dredge function
Attaching package: 'MuMIn'
The following object is masked from 'package:insight':
get_call
library(lme4) #for mixed models
Loading required package: Matrix
Attaching package: 'Matrix'
The following objects are masked from 'package:tidyr':
expand, pack, unpack
library(EnvStats) # for adding sample size
Attaching package: 'EnvStats'
The following object is masked from 'package:MASS':
boxcox
The following object is masked from 'package:car':
qqPlot
The following objects are masked from 'package:parameters':
kurtosis, skewness
The following objects are masked from 'package:datawizard':
kurtosis, skewness
The following objects are masked from 'package:stats':
predict, predict.lm
`geom_path()`: Each group consists of only one observation.
ℹ Do you need to adjust the group aesthetic?
`geom_path()`: Each group consists of only one observation.
ℹ Do you need to adjust the group aesthetic?
#fit best model, conduct factorial anovam<-lm (`final ABG DW (g)`~TMT*spp*`temp (C)`, data=data)hist(m$residuals) #heavy right skew, log transformation did not help
Call:
glm(formula = `final ABG DW (g)` ~ TMT + spp + `temp (C)`, data = data)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.08100 -0.04396 -0.02288 0.00791 0.81745
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.055750 0.013971 3.990 7.87e-05 ***
TMT0.5 0.025250 0.016698 1.512 0.131304
TMT1 0.015250 0.016698 0.913 0.361661
TMT10 -0.026262 0.016698 -1.573 0.116577
TMT20 -0.032875 0.016698 -1.969 0.049682 *
sppTN -0.008455 0.010561 -0.801 0.423850
`temp (C)`30 -0.037045 0.010561 -3.508 0.000504 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for gaussian family taken to be 0.01115327)
Null deviance: 4.7333 on 399 degrees of freedom
Residual deviance: 4.3832 on 393 degrees of freedom
AIC: -654.32
Number of Fisher Scoring iterations: 2
report(m4)
We fitted a linear model (estimated using ML) to predict final ABG DW (g) with
TMT, spp and temp (C) (formula: `final ABG DW (g)` ~ TMT + spp + `temp (C)`).
The model's explanatory power is weak (R2 = 0.07). The model's intercept,
corresponding to TMT = 0, spp = TB and temp (C) = 25, is at 0.06 (95% CI [0.03,
0.08], t(393) = 3.99, p < .001). Within this model:
- The effect of TMT [0.5] is statistically non-significant and positive (beta =
0.03, 95% CI [-7.48e-03, 0.06], t(393) = 1.51, p = 0.130; Std. beta = 0.23, 95%
CI [-0.07, 0.53])
- The effect of TMT [1] is statistically non-significant and positive (beta =
0.02, 95% CI [-0.02, 0.05], t(393) = 0.91, p = 0.361; Std. beta = 0.14, 95% CI
[-0.16, 0.44])
- The effect of TMT [10] is statistically non-significant and negative (beta =
-0.03, 95% CI [-0.06, 6.47e-03], t(393) = -1.57, p = 0.116; Std. beta = -0.24,
95% CI [-0.54, 0.06])
- The effect of TMT [20] is statistically significant and negative (beta =
-0.03, 95% CI [-0.07, -1.47e-04], t(393) = -1.97, p = 0.049; Std. beta = -0.30,
95% CI [-0.60, -1.35e-03])
- The effect of spp [TN] is statistically non-significant and negative (beta =
-8.46e-03, 95% CI [-0.03, 0.01], t(393) = -0.80, p = 0.423; Std. beta = -0.08,
95% CI [-0.27, 0.11])
- The effect of temp (C) [30] is statistically significant and negative (beta =
-0.04, 95% CI [-0.06, -0.02], t(393) = -3.51, p < .001; Std. beta = -0.34, 95%
CI [-0.53, -0.15])
Standardized parameters were obtained by fitting the model on a standardized
version of the dataset. 95% Confidence Intervals (CIs) and p-values were
computed using a Wald t-distribution approximation.
7.2 Post-hoc test
fitem<-emmeans(m4, ~ TMT+spp+`temp (C)`, type ="response")emdf<-as.data.frame(fitem) #put into dftukey_abg<- fitem %>%pairs() #tukey hsdtukeyabg<-as.data.frame(tukey_abg)tukeyabg
Call:
glm(formula = `final seed DW (g)` ~ TMT + spp + `temp (C)`, data = data)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.54107 -0.27717 -0.00107 0.49084 1.77633
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.43722 0.09848 4.440 1.17e-05 ***
TMT0.5 0.01125 0.11771 0.096 0.9239
TMT1 -0.15225 0.11771 -1.293 0.1966
TMT10 -0.22025 0.11771 -1.871 0.0621 .
TMT20 -0.24412 0.11771 -2.074 0.0387 *
sppTN 1.09260 0.07445 14.676 < 2e-16 ***
`temp (C)`30 -0.17130 0.07445 -2.301 0.0219 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for gaussian family taken to be 0.5542326)
Null deviance: 344.77 on 399 degrees of freedom
Residual deviance: 217.81 on 393 degrees of freedom
AIC: 908.02
Number of Fisher Scoring iterations: 2
report(m4)
We fitted a linear model (estimated using ML) to predict final seed DW (g) with
TMT, spp and temp (C) (formula: `final seed DW (g)` ~ TMT + spp + `temp (C)`).
The model's explanatory power is substantial (R2 = 0.37). The model's
intercept, corresponding to TMT = 0, spp = TB and temp (C) = 25, is at 0.44
(95% CI [0.24, 0.63], t(393) = 4.44, p < .001). Within this model:
- The effect of TMT [0.5] is statistically non-significant and positive (beta =
0.01, 95% CI [-0.22, 0.24], t(393) = 0.10, p = 0.924; Std. beta = 0.01, 95% CI
[-0.24, 0.26])
- The effect of TMT [1] is statistically non-significant and negative (beta =
-0.15, 95% CI [-0.38, 0.08], t(393) = -1.29, p = 0.196; Std. beta = -0.16, 95%
CI [-0.41, 0.08])
- The effect of TMT [10] is statistically non-significant and negative (beta =
-0.22, 95% CI [-0.45, 0.01], t(393) = -1.87, p = 0.061; Std. beta = -0.24, 95%
CI [-0.49, 0.01])
- The effect of TMT [20] is statistically significant and negative (beta =
-0.24, 95% CI [-0.47, -0.01], t(393) = -2.07, p = 0.038; Std. beta = -0.26, 95%
CI [-0.51, -0.01])
- The effect of spp [TN] is statistically significant and positive (beta =
1.09, 95% CI [0.95, 1.24], t(393) = 14.68, p < .001; Std. beta = 1.18, 95% CI
[1.02, 1.33])
- The effect of temp (C) [30] is statistically significant and negative (beta =
-0.17, 95% CI [-0.32, -0.03], t(393) = -2.30, p = 0.021; Std. beta = -0.18, 95%
CI [-0.34, -0.03])
Standardized parameters were obtained by fitting the model on a standardized
version of the dataset. 95% Confidence Intervals (CIs) and p-values were
computed using a Wald t-distribution approximation.
We fitted a logistic model (estimated using ML) to predict germination with
TMT, spp and temp (C) (formula: germination ~ TMT * spp + `temp (C)`). The
model's explanatory power is moderate (Tjur's R2 = 0.24). The model's
intercept, corresponding to TMT = 0, spp = TB and temp (C) = 25, is at 0.59
(95% CI [-0.17, 1.38], p = 0.131). Within this model:
- The effect of TMT [0.5] is statistically significant and negative (beta =
-1.29, 95% CI [-2.42, -0.22], p = 0.021; Std. beta = -1.29, 95% CI [-2.42,
-0.22])
- The effect of TMT [1] is statistically non-significant and negative (beta =
-0.39, 95% CI [-1.41, 0.61], p = 0.446; Std. beta = -0.39, 95% CI [-1.41,
0.61])
- The effect of TMT [10] is statistically significant and negative (beta =
-2.17, 95% CI [-3.58, -0.96], p < .001; Std. beta = -2.17, 95% CI [-3.58,
-0.96])
- The effect of TMT [20] is statistically non-significant and negative (beta =
-18.48, 95% CI [-397.09, 12.47], p = 0.985; Std. beta = -18.48, 95% CI
[-397.09, 12.47])
- The effect of spp [TN] is statistically significant and negative (beta =
-2.95, 95% CI [-4.89, -1.51], p < .001; Std. beta = -2.95, 95% CI [-4.89,
-1.51])
- The effect of temp (C) [30] is statistically significant and negative (beta =
-1.94, 95% CI [-2.74, -1.21], p < .001; Std. beta = -1.94, 95% CI [-2.74,
-1.21])
- The effect of TMT [0.5] × spp [TN] is statistically non-significant and
positive (beta = 2.06, 95% CI [0.03, 4.36], p = 0.054; Std. beta = 2.06, 95% CI
[0.03, 4.36])
- The effect of TMT [1] × spp [TN] is statistically non-significant and
positive (beta = 0.84, 95% CI [-1.28, 3.13], p = 0.441; Std. beta = 0.84, 95%
CI [-1.28, 3.13])
- The effect of TMT [10] × spp [TN] is statistically significant and positive
(beta = 2.62, 95% CI [0.37, 5.06], p = 0.024; Std. beta = 2.62, 95% CI [0.37,
5.06])
- The effect of TMT [20] × spp [TN] is statistically non-significant and
positive (beta = 18.48, 95% CI [-15.66, 379.62], p = 0.985; Std. beta = 18.48,
95% CI [-15.66, 379.62])
Standardized parameters were obtained by fitting the model on a standardized
version of the dataset. 95% Confidence Intervals (CIs) and p-values were
computed using a Wald z-distribution approximation.
Call:
glm(formula = viability ~ TMT + spp + `temp (C)`, family = binomial(link = "logit"),
data = data)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7426 -1.0835 0.7033 1.0976 1.7684
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.13364 0.27682 0.483 0.62926
TMT0.5 0.05704 0.33777 0.169 0.86591
TMT1 -0.49445 0.33315 -1.484 0.13776
TMT10 -0.82118 0.33537 -2.449 0.01434 *
TMT20 -1.10367 0.34029 -3.243 0.00118 **
sppTN 1.08031 0.21373 5.055 4.31e-07 ***
`temp (C)`30 -0.35869 0.21247 -1.688 0.09138 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 554.48 on 399 degrees of freedom
Residual deviance: 508.13 on 393 degrees of freedom
AIC: 522.13
Number of Fisher Scoring iterations: 4
report(m4)
We fitted a logistic model (estimated using ML) to predict viability with TMT,
spp and temp (C) (formula: viability ~ TMT + spp + `temp (C)`). The model's
explanatory power is weak (Tjur's R2 = 0.11). The model's intercept,
corresponding to TMT = 0, spp = TB and temp (C) = 25, is at 0.13 (95% CI
[-0.41, 0.68], p = 0.629). Within this model:
- The effect of TMT [0.5] is statistically non-significant and positive (beta =
0.06, 95% CI [-0.61, 0.72], p = 0.866; Std. beta = 0.06, 95% CI [-0.61, 0.72])
- The effect of TMT [1] is statistically non-significant and negative (beta =
-0.49, 95% CI [-1.15, 0.16], p = 0.138; Std. beta = -0.49, 95% CI [-1.15,
0.16])
- The effect of TMT [10] is statistically significant and negative (beta =
-0.82, 95% CI [-1.49, -0.17], p = 0.014; Std. beta = -0.82, 95% CI [-1.49,
-0.17])
- The effect of TMT [20] is statistically significant and negative (beta =
-1.10, 95% CI [-1.78, -0.44], p = 0.001; Std. beta = -1.10, 95% CI [-1.78,
-0.44])
- The effect of spp [TN] is statistically significant and positive (beta =
1.08, 95% CI [0.67, 1.50], p < .001; Std. beta = 1.08, 95% CI [0.67, 1.50])
- The effect of temp (C) [30] is statistically non-significant and negative
(beta = -0.36, 95% CI [-0.78, 0.06], p = 0.091; Std. beta = -0.36, 95% CI
[-0.78, 0.06])
Standardized parameters were obtained by fitting the model on a standardized
version of the dataset. 95% Confidence Intervals (CIs) and p-values were
computed using a Wald z-distribution approximation.