Import data + packages
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✔ ggplot2 3.3.6 ✔ purrr 0.3.4
## ✔ tibble 3.1.7 ✔ dplyr 1.0.9
## ✔ tidyr 1.2.0 ✔ stringr 1.4.0
## ✔ readr 2.1.2 ✔ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
library(ggplot2)
data <- read_csv("Louis Data.csv")
## Rows: 250 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): Treatment, Species, Status
## dbl (2): Height, Diameter
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#View(data)
data.water <- read_csv("Water Stress Data.csv")
## Rows: 62 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): Treatment, Species
## dbl (1): Water_Stress
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#View(data.water)
data.light <- read_csv("Light Data.csv")
## New names:
## Rows: 18 Columns: 3
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (1): Treatment dbl (1): Light lgl (1): ...3
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...3`
#View(data.light)
data.survival <- read_csv("Survival Data.csv")
## Rows: 12 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): Treatment, Species
## dbl (1): Survival
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#View(data.survival)
data.survival2 <- read_csv("Survival Data 2.csv")
## Rows: 235 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): Treatment, Species, Status
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#View(data.survival2)
Run ANOVA on Water stress/Treatment/Species
aov.water <- aov(Water_Stress ~ Treatment*Species, data = data.water)
summary(aov.water)
## Df Sum Sq Mean Sq F value Pr(>F)
## Treatment 3 7.85 2.615 1.874 0.1465
## Species 2 11.66 5.832 4.180 0.0212 *
## Treatment:Species 6 12.44 2.073 1.486 0.2032
## Residuals 48 66.98 1.395
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2 observations deleted due to missingness
TukeyHSD(aov.water)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Water_Stress ~ Treatment * Species, data = data.water)
##
## $Treatment
## diff lwr upr p adj
## 0NSPYHERB-0NSPNHERB -0.80400000 -1.9519314 0.3439314 0.2570381
## 0YSPNHERB-0NSPNHERB -0.07533333 -1.2232647 1.0725981 0.9980802
## 0YSPYHERB-0NSPNHERB -0.70733333 -1.8552647 0.4405981 0.3665169
## 0YSPNHERB-0NSPYHERB 0.72866667 -0.4192647 1.8765981 0.3404081
## 0YSPYHERB-0NSPYHERB 0.09666667 -1.0512647 1.2445981 0.9959753
## 0YSPYHERB-0YSPNHERB -0.63200000 -1.7799314 0.5159314 0.4660668
##
## $Species
## diff lwr upr p adj
## PP-GS -1.0530 -1.9564098 -0.1495902 0.0187937
## SP-GS -0.3185 -1.2219098 0.5849098 0.6724055
## SP-PP 0.7345 -0.1689098 1.6379098 0.1316439
##
## $`Treatment:Species`
## diff lwr upr p adj
## 0NSPYHERB:GS-0NSPNHERB:GS -0.556 -3.1212945 2.00929453 0.9998013
## 0YSPNHERB:GS-0NSPNHERB:GS -0.114 -2.6792945 2.45129453 1.0000000
## 0YSPYHERB:GS-0NSPNHERB:GS 0.736 -1.8292945 3.30129453 0.9973630
## 0NSPNHERB:PP-0NSPNHERB:GS -0.708 -3.2732945 1.85729453 0.9981260
## 0NSPYHERB:PP-0NSPNHERB:GS -1.096 -3.6612945 1.46929453 0.9423408
## 0YSPNHERB:PP-0NSPNHERB:GS -0.500 -3.0652945 2.06529453 0.9999295
## 0YSPYHERB:PP-0NSPNHERB:GS -1.842 -4.4072945 0.72329453 0.3850558
## 0NSPNHERB:SP-0NSPNHERB:GS 0.576 -1.9892945 3.14129453 0.9997211
## 0NSPYHERB:SP-0NSPNHERB:GS -0.892 -3.4572945 1.67329453 0.9869942
## 0YSPNHERB:SP-0NSPNHERB:GS 0.256 -2.3092945 2.82129453 0.9999999
## 0YSPYHERB:SP-0NSPNHERB:GS -1.148 -3.7132945 1.41729453 0.9223668
## 0YSPNHERB:GS-0NSPYHERB:GS 0.442 -2.1232945 3.00729453 0.9999795
## 0YSPYHERB:GS-0NSPYHERB:GS 1.292 -1.2732945 3.85729453 0.8456566
## 0NSPNHERB:PP-0NSPYHERB:GS -0.152 -2.7172945 2.41329453 1.0000000
## 0NSPYHERB:PP-0NSPYHERB:GS -0.540 -3.1052945 2.02529453 0.9998502
## 0YSPNHERB:PP-0NSPYHERB:GS 0.056 -2.5092945 2.62129453 1.0000000
## 0YSPYHERB:PP-0NSPYHERB:GS -1.286 -3.8512945 1.27929453 0.8494745
## 0NSPNHERB:SP-0NSPYHERB:GS 1.132 -1.4332945 3.69729453 0.9289400
## 0NSPYHERB:SP-0NSPYHERB:GS -0.336 -2.9012945 2.22929453 0.9999988
## 0YSPNHERB:SP-0NSPYHERB:GS 0.812 -1.7532945 3.37729453 0.9939082
## 0YSPYHERB:SP-0NSPYHERB:GS -0.592 -3.1572945 1.97329453 0.9996381
## 0YSPYHERB:GS-0YSPNHERB:GS 0.850 -1.7152945 3.41529453 0.9911394
## 0NSPNHERB:PP-0YSPNHERB:GS -0.594 -3.1592945 1.97129453 0.9996264
## 0NSPYHERB:PP-0YSPNHERB:GS -0.982 -3.5472945 1.58329453 0.9730909
## 0YSPNHERB:PP-0YSPNHERB:GS -0.386 -2.9512945 2.17929453 0.9999949
## 0YSPYHERB:PP-0YSPNHERB:GS -1.728 -4.2932945 0.83729453 0.4819190
## 0NSPNHERB:SP-0YSPNHERB:GS 0.690 -1.8752945 3.25529453 0.9985110
## 0NSPYHERB:SP-0YSPNHERB:GS -0.778 -3.3432945 1.78729453 0.9957468
## 0YSPNHERB:SP-0YSPNHERB:GS 0.370 -2.1952945 2.93529453 0.9999967
## 0YSPYHERB:SP-0YSPNHERB:GS -1.034 -3.5992945 1.53129453 0.9611326
## 0NSPNHERB:PP-0YSPYHERB:GS -1.444 -4.0092945 1.12129453 0.7333933
## 0NSPYHERB:PP-0YSPYHERB:GS -1.832 -4.3972945 0.73329453 0.3931915
## 0YSPNHERB:PP-0YSPYHERB:GS -1.236 -3.8012945 1.32929453 0.8792298
## 0YSPYHERB:PP-0YSPYHERB:GS -2.578 -5.1432945 -0.01270547 0.0478648
## 0NSPNHERB:SP-0YSPYHERB:GS -0.160 -2.7252945 2.40529453 1.0000000
## 0NSPYHERB:SP-0YSPYHERB:GS -1.628 -4.1932945 0.93729453 0.5717335
## 0YSPNHERB:SP-0YSPYHERB:GS -0.480 -3.0452945 2.08529453 0.9999530
## 0YSPYHERB:SP-0YSPYHERB:GS -1.884 -4.4492945 0.68129453 0.3518002
## 0NSPYHERB:PP-0NSPNHERB:PP -0.388 -2.9532945 2.17729453 0.9999946
## 0YSPNHERB:PP-0NSPNHERB:PP 0.208 -2.3572945 2.77329453 1.0000000
## 0YSPYHERB:PP-0NSPNHERB:PP -1.134 -3.6992945 1.43129453 0.9281394
## 0NSPNHERB:SP-0NSPNHERB:PP 1.284 -1.2812945 3.84929453 0.8507356
## 0NSPYHERB:SP-0NSPNHERB:PP -0.184 -2.7492945 2.38129453 1.0000000
## 0YSPNHERB:SP-0NSPNHERB:PP 0.964 -1.6012945 3.52929453 0.9765078
## 0YSPYHERB:SP-0NSPNHERB:PP -0.440 -3.0052945 2.12529453 0.9999804
## 0YSPNHERB:PP-0NSPYHERB:PP 0.596 -1.9692945 3.16129453 0.9996143
## 0YSPYHERB:PP-0NSPYHERB:PP -0.746 -3.3112945 1.81929453 0.9970345
## 0NSPNHERB:SP-0NSPYHERB:PP 1.672 -0.8932945 4.23729453 0.5319366
## 0NSPYHERB:SP-0NSPYHERB:PP 0.204 -2.3612945 2.76929453 1.0000000
## 0YSPNHERB:SP-0NSPYHERB:PP 1.352 -1.2132945 3.91729453 0.8047250
## 0YSPYHERB:SP-0NSPYHERB:PP -0.052 -2.6172945 2.51329453 1.0000000
## 0YSPYHERB:PP-0YSPNHERB:PP -1.342 -3.9072945 1.22329453 0.8118820
## 0NSPNHERB:SP-0YSPNHERB:PP 1.076 -1.4892945 3.64129453 0.9489780
## 0NSPYHERB:SP-0YSPNHERB:PP -0.392 -2.9572945 2.17329453 0.9999940
## 0YSPNHERB:SP-0YSPNHERB:PP 0.756 -1.8092945 3.32129453 0.9966726
## 0YSPYHERB:SP-0YSPNHERB:PP -0.648 -3.2132945 1.91729453 0.9991585
## 0NSPNHERB:SP-0YSPYHERB:PP 2.418 -0.1472945 4.98329453 0.0815521
## 0NSPYHERB:SP-0YSPYHERB:PP 0.950 -1.6152945 3.51529453 0.9789300
## 0YSPNHERB:SP-0YSPYHERB:PP 2.098 -0.4672945 4.66329453 0.2091480
## 0YSPYHERB:SP-0YSPYHERB:PP 0.694 -1.8712945 3.25929453 0.9984317
## 0NSPYHERB:SP-0NSPNHERB:SP -1.468 -4.0332945 1.09729453 0.7133937
## 0YSPNHERB:SP-0NSPNHERB:SP -0.320 -2.8852945 2.24529453 0.9999993
## 0YSPYHERB:SP-0NSPNHERB:SP -1.724 -4.2892945 0.84129453 0.4854538
## 0YSPNHERB:SP-0NSPYHERB:SP 1.148 -1.4172945 3.71329453 0.9223668
## 0YSPYHERB:SP-0NSPYHERB:SP -0.256 -2.8212945 2.30929453 0.9999999
## 0YSPYHERB:SP-0YSPNHERB:SP -1.404 -3.9692945 1.16129453 0.7655410
Run ANOVA on Height/Treatment/Species
aov.height <- aov(Height ~ Treatment*Species, data = data)
summary(aov.height)
## Df Sum Sq Mean Sq F value Pr(>F)
## Treatment 3 974 324.8 21.275 4.17e-12 ***
## Species 2 5570 2784.9 182.438 < 2e-16 ***
## Treatment:Species 6 714 119.0 7.797 1.33e-07 ***
## Residuals 215 3282 15.3
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
TukeyHSD(aov.height)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Height ~ Treatment * Species, data = data)
##
## $Treatment
## diff lwr upr p adj
## 0NSPYHERB-0NSPNHERB -0.8649528 -2.888575 1.158670 0.6857979
## 0YSPNHERB-0NSPNHERB -0.4203230 -2.463927 1.623281 0.9510642
## 0YSPYHERB-0NSPNHERB -5.5731137 -7.780051 -3.366176 0.0000000
## 0YSPNHERB-0NSPYHERB 0.4446297 -1.253925 2.143184 0.9054372
## 0YSPYHERB-0NSPYHERB -4.7081609 -6.600076 -2.816246 0.0000000
## 0YSPYHERB-0YSPNHERB -5.1527906 -7.066063 -3.239518 0.0000000
##
## $Species
## diff lwr upr p adj
## PP-GS 1.275761 -0.4012799 2.952801 0.1735628
## SP-GS -9.194477 -10.6922152 -7.696740 0.0000000
## SP-PP -10.470238 -11.9445135 -8.995963 0.0000000
##
## $`Treatment:Species`
## diff lwr upr p adj
## 0NSPYHERB:GS-0NSPNHERB:GS 0.49500000 -4.90598518 5.89598518 1.0000000
## 0YSPNHERB:GS-0NSPNHERB:GS -5.45000000 -10.85098518 -0.04901482 0.0457367
## 0YSPYHERB:GS-0NSPNHERB:GS -4.90909091 -10.90823683 1.09005501 0.2315258
## 0NSPNHERB:PP-0NSPNHERB:GS 0.35000000 -5.77414155 6.47414155 1.0000000
## 0NSPYHERB:PP-0NSPNHERB:GS -0.03888889 -5.52493419 5.44715641 1.0000000
## 0YSPNHERB:PP-0NSPNHERB:GS -1.45238095 -6.81649891 3.91173700 0.9991207
## 0YSPYHERB:PP-0NSPNHERB:GS -4.57692308 -10.37851181 1.22466565 0.2824874
## 0NSPNHERB:SP-0NSPNHERB:GS -9.79885000 -15.19983518 -4.39786482 0.0000006
## 0NSPYHERB:SP-0NSPNHERB:GS -12.63142857 -17.69094690 -7.57191025 0.0000000
## 0YSPNHERB:SP-0NSPNHERB:GS -8.53571429 -13.71155857 -3.35987000 0.0000089
## 0YSPYHERB:SP-0NSPNHERB:GS -16.80434783 -22.10373801 -11.50495765 0.0000000
## 0YSPNHERB:GS-0NSPYHERB:GS -5.94500000 -10.02776103 -1.86223897 0.0001751
## 0YSPYHERB:GS-0NSPYHERB:GS -5.40409091 -10.25053791 -0.55764391 0.0149269
## 0NSPNHERB:PP-0NSPYHERB:GS -0.14500000 -5.14534064 4.85534064 1.0000000
## 0NSPYHERB:PP-0NSPYHERB:GS -0.53388889 -4.72852710 3.66074933 0.9999996
## 0YSPNHERB:PP-0NSPYHERB:GS -1.94738095 -5.98124488 2.08648298 0.9091761
## 0YSPYHERB:PP-0NSPYHERB:GS -5.07192308 -9.67156747 -0.47227868 0.0171367
## 0NSPNHERB:SP-0NSPYHERB:GS -10.29385000 -14.37661103 -6.21108897 0.0000000
## 0NSPYHERB:SP-0NSPYHERB:GS -13.12642857 -16.74540943 -9.50744771 0.0000000
## 0YSPNHERB:SP-0NSPYHERB:GS -9.03071429 -12.81061651 -5.25081206 0.0000000
## 0YSPYHERB:SP-0NSPYHERB:GS -17.29934783 -21.24673089 -13.35196477 0.0000000
## 0YSPYHERB:GS-0YSPNHERB:GS 0.54090909 -4.30553791 5.38735609 0.9999999
## 0NSPNHERB:PP-0YSPNHERB:GS 5.80000000 0.79965936 10.80034064 0.0089175
## 0NSPYHERB:PP-0YSPNHERB:GS 5.41111111 1.21647290 9.60574933 0.0017659
## 0YSPNHERB:PP-0YSPNHERB:GS 3.99761905 -0.03624488 8.03148298 0.0545524
## 0YSPYHERB:PP-0YSPNHERB:GS 0.87307692 -3.72656747 5.47272132 0.9999726
## 0NSPNHERB:SP-0YSPNHERB:GS -4.34885000 -8.43161103 -0.26608897 0.0257359
## 0NSPYHERB:SP-0YSPNHERB:GS -7.18142857 -10.80040943 -3.56244771 0.0000000
## 0YSPNHERB:SP-0YSPNHERB:GS -3.08571429 -6.86561651 0.69418794 0.2347089
## 0YSPYHERB:SP-0YSPNHERB:GS -11.35434783 -15.30173089 -7.40696477 0.0000000
## 0NSPNHERB:PP-0YSPYHERB:GS 5.25909091 -0.38205413 10.90023595 0.0937873
## 0NSPYHERB:PP-0YSPYHERB:GS 4.87020202 -0.07086068 9.81126472 0.0574307
## 0YSPNHERB:PP-0YSPYHERB:GS 3.45670996 -1.34861720 8.26203711 0.4261961
## 0YSPYHERB:PP-0YSPYHERB:GS 0.33216783 -4.95705134 5.62138700 1.0000000
## 0NSPNHERB:SP-0YSPYHERB:GS -4.88975909 -9.73620609 -0.04331209 0.0457992
## 0NSPYHERB:SP-0YSPYHERB:GS -7.72233766 -12.18508719 -3.25958814 0.0000023
## 0YSPNHERB:SP-0YSPYHERB:GS -3.62662338 -8.22083405 0.96758730 0.2816018
## 0YSPYHERB:SP-0YSPYHERB:GS -11.89525692 -16.62822046 -7.16229338 0.0000000
## 0NSPYHERB:PP-0NSPNHERB:PP -0.38888889 -5.48098655 4.70320877 1.0000000
## 0YSPNHERB:PP-0NSPNHERB:PP -1.80238095 -6.76287760 3.15811570 0.9884574
## 0YSPYHERB:PP-0NSPNHERB:PP -4.92692308 -10.35750292 0.50365676 0.1163528
## 0NSPNHERB:SP-0NSPNHERB:PP -10.14885000 -15.14919064 -5.14850936 0.0000000
## 0NSPYHERB:SP-0NSPNHERB:PP -12.98142857 -17.61084444 -8.35201270 0.0000000
## 0YSPNHERB:SP-0NSPNHERB:PP -8.88571429 -13.64198695 -4.12944162 0.0000002
## 0YSPYHERB:SP-0NSPNHERB:PP -17.15434783 -22.04477745 -12.26391821 0.0000000
## 0YSPNHERB:PP-0NSPYHERB:PP -1.41349206 -5.56055250 2.73356838 0.9931938
## 0YSPYHERB:PP-0NSPYHERB:PP -4.53803419 -9.23726611 0.16119773 0.0693180
## 0NSPNHERB:SP-0NSPYHERB:PP -9.75996111 -13.95459933 -5.56532290 0.0000000
## 0NSPYHERB:SP-0NSPYHERB:PP -12.59253968 -16.33727926 -8.84780010 0.0000000
## 0YSPNHERB:SP-0NSPYHERB:PP -8.49682540 -12.39730139 -4.59634941 0.0000000
## 0YSPYHERB:SP-0NSPYHERB:PP -16.76545894 -20.82844861 -12.70246926 0.0000000
## 0YSPYHERB:PP-0YSPNHERB:PP -3.12454212 -7.68083986 1.43175562 0.5039840
## 0NSPNHERB:SP-0YSPNHERB:PP -8.34646905 -12.38033298 -4.31260512 0.0000000
## 0NSPYHERB:SP-0YSPNHERB:PP -11.17904762 -14.74277362 -7.61532162 0.0000000
## 0YSPNHERB:SP-0YSPNHERB:PP -7.08333333 -10.81036719 -3.35629947 0.0000001
## 0YSPYHERB:SP-0YSPNHERB:PP -15.35196687 -19.24875447 -11.45517928 0.0000000
## 0NSPNHERB:SP-0YSPYHERB:PP -5.22192692 -9.82157132 -0.62228253 0.0118672
## 0NSPYHERB:SP-0YSPYHERB:PP -8.05450549 -12.24793051 -3.86108048 0.0000001
## 0YSPNHERB:SP-0YSPYHERB:PP -3.95879121 -8.29185615 0.37427373 0.1102372
## 0YSPYHERB:SP-0YSPYHERB:PP -12.22742475 -16.70733813 -7.74751136 0.0000000
## 0NSPYHERB:SP-0NSPNHERB:SP -2.83257857 -6.45155943 0.78640229 0.2940579
## 0YSPNHERB:SP-0NSPNHERB:SP 1.26313571 -2.51676651 5.04303794 0.9942418
## 0YSPYHERB:SP-0NSPNHERB:SP -7.00549783 -10.95288089 -3.05811477 0.0000011
## 0YSPNHERB:SP-0NSPYHERB:SP 4.09571429 0.82222293 7.36920564 0.0029174
## 0YSPYHERB:SP-0NSPYHERB:SP -4.17291925 -7.63845209 -0.70738642 0.0052493
## 0YSPYHERB:SP-0YSPNHERB:SP -8.26863354 -11.90189051 -4.63537657 0.0000000
Run ANOVA on DBH/Treatment/Species
aov.dbh <- aov(Diameter ~ Treatment*Species, data = data)
summary(aov.dbh)
## Df Sum Sq Mean Sq F value Pr(>F)
## Treatment 3 17.43 5.81 7.664 6.86e-05 ***
## Species 2 250.30 125.15 165.079 < 2e-16 ***
## Treatment:Species 6 5.39 0.90 1.184 0.316
## Residuals 215 163.00 0.76
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 23 observations deleted due to missingness
TukeyHSD(aov.dbh)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Diameter ~ Treatment * Species, data = data)
##
## $Treatment
## diff lwr upr p adj
## 0NSPYHERB-0NSPNHERB 0.7242249 0.27324841 1.17520149 0.0002694
## 0YSPNHERB-0NSPNHERB 0.5308162 0.07538659 0.98624575 0.0150276
## 0YSPYHERB-0NSPNHERB 0.1615901 -0.33023919 0.65341948 0.8300479
## 0YSPNHERB-0NSPYHERB -0.1934088 -0.57194190 0.18512435 0.5493328
## 0YSPYHERB-0NSPYHERB -0.5626348 -0.98425941 -0.14101019 0.0036768
## 0YSPYHERB-0YSPNHERB -0.3692260 -0.79561033 0.05715828 0.1153116
##
## $Species
## diff lwr upr p adj
## PP-GS 0.09576482 -0.2779738 0.4695034 0.8176876
## SP-GS -2.04662766 -2.3804076 -1.7128477 0.0000000
## SP-PP -2.14239247 -2.4709436 -1.8138413 0.0000000
##
## $`Treatment:Species`
## diff lwr upr p adj
## 0NSPYHERB:GS-0NSPNHERB:GS 1.095000000 -0.1086422 2.29864219 0.1139369
## 0YSPNHERB:GS-0NSPNHERB:GS 0.265000000 -0.9386422 1.46864219 0.9998793
## 0YSPYHERB:GS-0NSPNHERB:GS 0.206818182 -1.1301277 1.54376411 0.9999967
## 0NSPNHERB:PP-0NSPNHERB:GS 0.155000000 -1.2098020 1.51980196 0.9999999
## 0NSPYHERB:PP-0NSPNHERB:GS 0.930555556 -0.2920428 2.15315390 0.3363259
## 0YSPNHERB:PP-0NSPNHERB:GS 0.501190476 -0.6942356 1.69661658 0.9652238
## 0YSPYHERB:PP-0NSPNHERB:GS 0.471153846 -0.8217653 1.76407296 0.9881809
## 0NSPNHERB:SP-0NSPNHERB:GS -1.760000000 -2.9636422 -0.55635781 0.0001601
## 0NSPYHERB:SP-0NSPNHERB:GS -1.440714286 -2.5682585 -0.31317005 0.0020727
## 0YSPNHERB:SP-0NSPNHERB:GS -1.439285714 -2.5927539 -0.28581753 0.0030457
## 0YSPYHERB:SP-0NSPNHERB:GS -1.844565217 -3.0255663 -0.66356409 0.0000355
## 0YSPNHERB:GS-0NSPYHERB:GS -0.830000000 -1.7398680 0.07986797 0.1115626
## 0YSPYHERB:GS-0NSPYHERB:GS -0.888181818 -1.9682418 0.19187819 0.2250141
## 0NSPNHERB:PP-0NSPYHERB:GS -0.940000000 -2.0543561 0.17435613 0.1929347
## 0NSPYHERB:PP-0NSPYHERB:GS -0.164444444 -1.0992449 0.77035603 0.9999874
## 0YSPNHERB:PP-0NSPYHERB:GS -0.593809524 -1.4927805 0.30516143 0.5639386
## 0YSPYHERB:PP-0NSPYHERB:GS -0.623846154 -1.6489047 0.40121240 0.6854423
## 0NSPNHERB:SP-0NSPYHERB:GS -2.855000000 -3.7648680 -1.94513203 0.0000000
## 0NSPYHERB:SP-0NSPYHERB:GS -2.535714286 -3.3422260 -1.72920253 0.0000000
## 0YSPNHERB:SP-0NSPYHERB:GS -2.534285714 -3.3766598 -1.69191166 0.0000000
## 0YSPYHERB:SP-0NSPYHERB:GS -2.939565217 -3.8192634 -2.05986705 0.0000000
## 0YSPYHERB:GS-0YSPNHERB:GS -0.058181818 -1.1382418 1.02187819 1.0000000
## 0NSPNHERB:PP-0YSPNHERB:GS -0.110000000 -1.2243561 1.00435613 1.0000000
## 0NSPYHERB:PP-0YSPNHERB:GS 0.665555556 -0.2692449 1.60035603 0.4429485
## 0YSPNHERB:PP-0YSPNHERB:GS 0.236190476 -0.6627805 1.13516143 0.9993364
## 0YSPYHERB:PP-0YSPNHERB:GS 0.206153846 -0.8189047 1.23121240 0.9999510
## 0NSPNHERB:SP-0YSPNHERB:GS -2.025000000 -2.9348680 -1.11513203 0.0000000
## 0NSPYHERB:SP-0YSPNHERB:GS -1.705714286 -2.5122260 -0.89920253 0.0000000
## 0YSPNHERB:SP-0YSPNHERB:GS -1.704285714 -2.5466598 -0.86191166 0.0000000
## 0YSPYHERB:SP-0YSPNHERB:GS -2.109565217 -2.9892634 -1.22986705 0.0000000
## 0NSPNHERB:PP-0YSPYHERB:GS -0.051818182 -1.3089814 1.20534508 1.0000000
## 0NSPYHERB:PP-0YSPYHERB:GS 0.723737374 -0.3774083 1.82488306 0.5717679
## 0YSPNHERB:PP-0YSPYHERB:GS 0.294372294 -0.7765239 1.36526849 0.9989882
## 0YSPYHERB:PP-0YSPYHERB:GS 0.264335664 -0.9143988 1.44307012 0.9998553
## 0NSPNHERB:SP-0YSPYHERB:GS -1.966818182 -3.0468782 -0.88675818 0.0000005
## 0NSPYHERB:SP-0YSPYHERB:GS -1.647532468 -2.6420832 -0.65298177 0.0000079
## 0YSPNHERB:SP-0YSPYHERB:GS -1.646103896 -2.6699515 -0.62225628 0.0000172
## 0YSPYHERB:SP-0YSPYHERB:GS -2.051383399 -3.1061529 -0.99661387 0.0000001
## 0NSPYHERB:PP-0NSPNHERB:PP 0.775555556 -0.3592492 1.91036029 0.5095089
## 0YSPNHERB:PP-0NSPNHERB:PP 0.346190476 -0.7592862 1.45166713 0.9967161
## 0YSPYHERB:PP-0NSPNHERB:PP 0.316153846 -0.8940837 1.52639138 0.9993713
## 0NSPNHERB:SP-0NSPNHERB:PP -1.915000000 -3.0293561 -0.80064387 0.0000028
## 0NSPYHERB:SP-0NSPNHERB:PP -1.595714286 -2.6274076 -0.56402098 0.0000448
## 0YSPNHERB:SP-0NSPNHERB:PP -1.594285714 -2.6542498 -0.53432161 0.0000858
## 0YSPYHERB:SP-0NSPNHERB:PP -1.999565217 -3.0894270 -0.90970342 0.0000004
## 0YSPNHERB:PP-0NSPYHERB:PP -0.429365079 -1.3535626 0.49483240 0.9290822
## 0YSPYHERB:PP-0NSPYHERB:PP -0.459401709 -1.5066539 0.58785052 0.9519634
## 0NSPNHERB:SP-0NSPYHERB:PP -2.690555556 -3.6253560 -1.75575508 0.0000000
## 0NSPYHERB:SP-0NSPYHERB:PP -2.371269841 -3.2058077 -1.53673199 0.0000000
## 0YSPNHERB:SP-0NSPYHERB:PP -2.369841270 -3.2390859 -1.50059662 0.0000000
## 0YSPYHERB:SP-0NSPYHERB:PP -2.775120773 -3.6805826 -1.86965897 0.0000000
## 0YSPYHERB:PP-0YSPNHERB:PP -0.030036630 -1.0454351 0.98536186 1.0000000
## 0NSPNHERB:SP-0YSPNHERB:PP -2.261190476 -3.1601614 -1.36221952 0.0000000
## 0NSPYHERB:SP-0YSPNHERB:PP -1.941904762 -2.7361026 -1.14770689 0.0000000
## 0YSPNHERB:SP-0YSPNHERB:PP -1.940476190 -2.7710682 -1.10988417 0.0000000
## 0YSPYHERB:SP-0YSPNHERB:PP -2.345755694 -3.2141784 -1.47733303 0.0000000
## 0NSPNHERB:SP-0YSPYHERB:PP -2.231153846 -3.2562124 -1.20609529 0.0000000
## 0NSPYHERB:SP-0YSPYHERB:PP -1.911868132 -2.8463982 -0.97733802 0.0000000
## 0YSPNHERB:SP-0YSPYHERB:PP -1.910439560 -2.8760893 -0.94478985 0.0000000
## 0YSPYHERB:SP-0YSPYHERB:PP -2.315719064 -3.3140948 -1.31734329 0.0000000
## 0NSPYHERB:SP-0NSPNHERB:SP 0.319285714 -0.4872260 1.12579747 0.9773284
## 0YSPNHERB:SP-0NSPNHERB:SP 0.320714286 -0.5216598 1.16308834 0.9832427
## 0YSPYHERB:SP-0NSPNHERB:SP -0.084565217 -0.9642634 0.79513295 1.0000000
## 0YSPNHERB:SP-0NSPYHERB:SP 0.001428571 -0.7280888 0.73094590 1.0000000
## 0YSPYHERB:SP-0NSPYHERB:SP -0.403850932 -1.1761659 0.36846400 0.8533835
## 0YSPYHERB:SP-0YSPNHERB:SP -0.405279503 -1.2149728 0.40441377 0.8864908
Run ANOVA on Light/Treatment
aov.light <- aov(Light ~ Treatment, data = data.light)
summary(aov.light)
## Df Sum Sq Mean Sq F value Pr(>F)
## Treatment 3 3125 1041.6 10.26 0.000781 ***
## Residuals 14 1421 101.5
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(aov.light)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Light ~ Treatment, data = data.light)
##
## $Treatment
## diff lwr upr p adj
## 0NSPYHERB-0NSPNHERB -12.1680 -31.8126876 7.476688 0.3136417
## 0YSPNHERB-0NSPNHERB 15.1020 -4.5426876 34.746688 0.1617439
## 0YSPYHERB-0NSPNHERB 21.1675 0.4601811 41.874819 0.0444023
## 0YSPNHERB-0NSPYHERB 27.2700 8.7488109 45.791189 0.0037579
## 0YSPYHERB-0NSPYHERB 33.3355 13.6908124 52.980188 0.0011181
## 0YSPYHERB-0YSPNHERB 6.0655 -13.5791876 25.710188 0.8063339
Run ANOVA on Survival/Treatment/Species
data.survival2 <- data.survival2 %>%
mutate(Status2 = recode(Status,
"D" = "0",
"L" = "1"))
aov.survival <- aov(Status2 ~ Treatment*Species, data = data.survival2)
summary(aov.survival)
## Df Sum Sq Mean Sq F value Pr(>F)
## Treatment 3 0.171 0.05710 2.009 0.114
## Species 2 0.119 0.05948 2.093 0.126
## Treatment:Species 6 0.162 0.02706 0.952 0.459
## Residuals 223 6.339 0.02843
TukeyHSD(aov.survival)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Status2 ~ Treatment * Species, data = data.survival2)
##
## $Treatment
## diff lwr upr p adj
## 0NSPYHERB-0NSPNHERB 0.025641026 -0.06091930 0.112201348 0.8693360
## 0YSPNHERB-0NSPNHERB -0.041025641 -0.12718314 0.045131857 0.6068231
## 0YSPYHERB-0NSPNHERB 0.004807692 -0.08927512 0.098890505 0.9991715
## 0YSPNHERB-0NSPYHERB -0.066666667 -0.13842005 0.005086716 0.0790496
## 0YSPYHERB-0NSPYHERB -0.020833333 -0.10193209 0.060265428 0.9101450
## 0YSPYHERB-0YSPNHERB 0.045833333 -0.03483534 0.126502002 0.4569570
##
## $Species
## diff lwr upr p adj
## PP-GS 0.06139808 -0.009489177 0.13228533 0.1043010
## SP-GS 0.03043112 -0.032214183 0.09307642 0.4867739
## SP-PP -0.03096695 -0.094245672 0.03231176 0.4816113
##
## $`Treatment:Species`
## diff lwr upr p adj
## 0NSPYHERB:GS-0NSPNHERB:GS 1.111111e-01 -0.11242545 0.33464767 0.8915177
## 0YSPNHERB:GS-0NSPNHERB:GS -1.388889e-02 -0.23156758 0.20378980 1.0000000
## 0YSPYHERB:GS-0NSPNHERB:GS 1.111111e-01 -0.13920178 0.36142401 0.9480545
## 0NSPNHERB:PP-0NSPNHERB:GS 1.111111e-01 -0.14477185 0.36699407 0.9554584
## 0NSPYHERB:PP-0NSPNHERB:GS 1.111111e-01 -0.11624687 0.33846909 0.9022613
## 0YSPNHERB:PP-0NSPNHERB:GS 1.111111e-01 -0.11076756 0.33298978 0.8865133
## 0YSPYHERB:PP-0NSPNHERB:GS 1.111111e-01 -0.13038171 0.35260394 0.9337316
## 0NSPNHERB:SP-0NSPNHERB:GS 1.111111e-01 -0.11242545 0.33464767 0.8915177
## 0NSPYHERB:SP-0NSPNHERB:GS 1.111111e-01 -0.09702953 0.31925175 0.8358631
## 0YSPNHERB:SP-0NSPNHERB:GS 4.444444e-02 -0.16721431 0.25610320 0.9999250
## 0YSPYHERB:SP-0NSPNHERB:GS 6.944444e-02 -0.14823425 0.28712314 0.9961596
## 0YSPNHERB:GS-0NSPYHERB:GS -1.250000e-01 -0.29361319 0.04361319 0.3781479
## 0YSPYHERB:GS-0NSPYHERB:GS 2.220446e-16 -0.20905248 0.20905248 1.0000000
## 0NSPNHERB:PP-0NSPYHERB:GS 2.220446e-16 -0.21569072 0.21569072 1.0000000
## 0NSPYHERB:PP-0NSPYHERB:GS 4.440892e-16 -0.18093658 0.18093658 1.0000000
## 0YSPNHERB:PP-0NSPYHERB:GS 2.220446e-16 -0.17400155 0.17400155 1.0000000
## 0YSPYHERB:PP-0NSPYHERB:GS 1.554312e-15 -0.19840660 0.19840660 1.0000000
## 0NSPNHERB:SP-0NSPYHERB:GS 2.220446e-16 -0.17611073 0.17611073 1.0000000
## 0NSPYHERB:SP-0NSPYHERB:GS 2.220446e-16 -0.15610548 0.15610548 1.0000000
## 0YSPNHERB:SP-0NSPYHERB:GS -6.666667e-02 -0.22743303 0.09409970 0.9680445
## 0YSPYHERB:SP-0NSPYHERB:GS -4.166667e-02 -0.21027986 0.12694652 0.9996316
## 0YSPYHERB:GS-0YSPNHERB:GS 1.250000e-01 -0.07777662 0.32777662 0.6681834
## 0NSPNHERB:PP-0YSPNHERB:GS 1.250000e-01 -0.08461370 0.33461370 0.7132527
## 0NSPYHERB:PP-0YSPNHERB:GS 1.250000e-01 -0.04864752 0.29864752 0.4255574
## 0YSPNHERB:PP-0YSPNHERB:GS 1.250000e-01 -0.04140900 0.29140900 0.3573005
## 0YSPYHERB:PP-0YSPNHERB:GS 1.250000e-01 -0.06678268 0.31678268 0.5853854
## 0NSPNHERB:SP-0YSPNHERB:GS 1.250000e-01 -0.04361319 0.29361319 0.3781479
## 0NSPYHERB:SP-0YSPNHERB:GS 1.250000e-01 -0.02259518 0.27259518 0.1883389
## 0YSPNHERB:SP-0YSPNHERB:GS 5.833333e-02 -0.09418303 0.21084970 0.9827133
## 0YSPYHERB:SP-0YSPNHERB:GS 8.333333e-02 -0.07743303 0.24409970 0.8609338
## 0NSPNHERB:PP-0YSPYHERB:GS 0.000000e+00 -0.24333195 0.24333195 1.0000000
## 0NSPYHERB:PP-0YSPYHERB:GS 2.220446e-16 -0.21313375 0.21313375 1.0000000
## 0YSPNHERB:PP-0YSPYHERB:GS 0.000000e+00 -0.20727877 0.20727877 1.0000000
## 0YSPYHERB:PP-0YSPYHERB:GS 1.332268e-15 -0.22815155 0.22815155 1.0000000
## 0NSPNHERB:SP-0YSPYHERB:GS 0.000000e+00 -0.20905248 0.20905248 1.0000000
## 0NSPYHERB:SP-0YSPYHERB:GS 0.000000e+00 -0.19250161 0.19250161 1.0000000
## 0YSPNHERB:SP-0YSPYHERB:GS -6.666667e-02 -0.26296688 0.12963355 0.9934327
## 0YSPYHERB:SP-0YSPYHERB:GS -4.166667e-02 -0.24444329 0.16110995 0.9999396
## 0NSPYHERB:PP-0NSPNHERB:PP 2.220446e-16 -0.21964867 0.21964867 1.0000000
## 0YSPNHERB:PP-0NSPNHERB:PP 0.000000e+00 -0.21397204 0.21397204 1.0000000
## 0YSPYHERB:PP-0NSPNHERB:PP 1.332268e-15 -0.23424917 0.23424917 1.0000000
## 0NSPNHERB:SP-0NSPNHERB:PP 0.000000e+00 -0.21569072 0.21569072 1.0000000
## 0NSPYHERB:SP-0NSPNHERB:PP 0.000000e+00 -0.19969080 0.19969080 1.0000000
## 0YSPNHERB:SP-0NSPNHERB:PP -6.666667e-02 -0.27002182 0.13668849 0.9951384
## 0YSPYHERB:SP-0NSPNHERB:PP -4.166667e-02 -0.25128036 0.16794703 0.9999567
## 0YSPNHERB:PP-0NSPYHERB:PP -2.220446e-16 -0.17888430 0.17888430 1.0000000
## 0YSPYHERB:PP-0NSPYHERB:PP 1.110223e-15 -0.20270233 0.20270233 1.0000000
## 0NSPNHERB:SP-0NSPYHERB:PP -2.220446e-16 -0.18093658 0.18093658 1.0000000
## 0NSPYHERB:SP-0NSPYHERB:PP -2.220446e-16 -0.16153011 0.16153011 1.0000000
## 0YSPNHERB:SP-0NSPYHERB:PP -6.666667e-02 -0.23270546 0.09937212 0.9748777
## 0YSPYHERB:SP-0NSPYHERB:PP -4.166667e-02 -0.21531419 0.13198086 0.9997224
## 0YSPYHERB:PP-0YSPNHERB:PP 1.332268e-15 -0.19653683 0.19653683 1.0000000
## 0NSPNHERB:SP-0YSPNHERB:PP 0.000000e+00 -0.17400155 0.17400155 1.0000000
## 0NSPYHERB:SP-0YSPNHERB:PP 0.000000e+00 -0.15372205 0.15372205 1.0000000
## 0YSPNHERB:SP-0YSPNHERB:PP -6.666667e-02 -0.22511973 0.09178640 0.9644724
## 0YSPYHERB:SP-0YSPNHERB:PP -4.166667e-02 -0.20807567 0.12474233 0.9995822
## 0NSPNHERB:SP-0YSPYHERB:PP -1.332268e-15 -0.19840660 0.19840660 1.0000000
## 0NSPYHERB:SP-0YSPYHERB:PP -1.332268e-15 -0.18088425 0.18088425 1.0000000
## 0YSPNHERB:SP-0YSPYHERB:PP -6.666667e-02 -0.25158831 0.11825498 0.9892235
## 0YSPYHERB:SP-0YSPYHERB:PP -4.166667e-02 -0.23344935 0.15011602 0.9998949
## 0NSPYHERB:SP-0NSPNHERB:SP 0.000000e+00 -0.15610548 0.15610548 1.0000000
## 0YSPNHERB:SP-0NSPNHERB:SP -6.666667e-02 -0.22743303 0.09409970 0.9680445
## 0YSPYHERB:SP-0NSPNHERB:SP -4.166667e-02 -0.21027986 0.12694652 0.9996316
## 0YSPNHERB:SP-0NSPYHERB:SP -6.666667e-02 -0.20522985 0.07189652 0.9113928
## 0YSPYHERB:SP-0NSPYHERB:SP -4.166667e-02 -0.18926185 0.10592852 0.9987147
## 0YSPYHERB:SP-0YSPNHERB:SP 2.500000e-02 -0.12751637 0.17751637 0.9999940
Height Box Plot
#drop NA values
data.dropna <- na.omit(data)
data.dropna %>%
ggplot(aes(x=Treatment, y = Height, fill=Treatment)) +
geom_boxplot() +
facet_wrap(~Species) +
labs(title = "Treatment Effects on Height by Species", y = "Height (cm)")+
scale_x_discrete(labels = c("0YSPYHERB" = "Salvage+Herbicide",
"0NSPYHERB" = "Herbicide",
"0YSPNHERB" = "Salvage",
"0NSPNHERB" = "No Treatment"),
guide = guide_axis(angle = -45))
#Alternative label option
# scale_x_discrete(labels = c("0YSPYHERB" = "Salvage & Herbicide",
# "0NSPYHERB" = "Herbicide Only",
# "0YSPNHERB" = "Salvage Only",
# "0NSPNHERB" = "No Treatment"))
Diameter Box PLot
data.dropna %>%
ggplot(aes(x=Treatment, y = Diameter, fill=Treatment)) +
geom_boxplot() +
facet_wrap(~Species) +
labs(title = "Treatment Effects on Diameter by Species", y = "Diameter (mm)")+
scale_x_discrete(labels = c("0YSPYHERB" = "Salvage+Herbicide",
"0NSPYHERB" = "Herbicide",
"0YSPNHERB" = "Salvage",
"0NSPNHERB" = "No Treatment"),
guide = guide_axis(angle = -45))
#Alternative label option
# scale_x_discrete(labels = c("0YSPYHERB" = "Salvage & Herbicide",
# "0NSPYHERB" = "Herbicide Only",
# "0YSPNHERB" = "Salvage Only",
# "0NSPNHERB" = "No Treatment"))
Water Stress Box Plot
#drop NA values
data.water.dropna <- na.omit(data.water)
data.water.dropna %>%
ggplot(aes(x=Treatment, y = Water_Stress, fill = Treatment)) +
geom_boxplot() +
facet_wrap(~Species) +
labs(title = "Treatment Effects on Water Stress by Species", y = "δ13C (‰ VPDB)")+
scale_x_discrete(labels = c("0YSPYHERB" = "Salvage+Herbicide",
"0NSPYHERB" = "Herbicide",
"0YSPNHERB" = "Salvage",
"0NSPNHERB" = "No Treatment"),
guide = guide_axis(angle = -45))
#Alternative label option
# scale_x_discrete(labels = c("0YSPYHERB" = "Salvage & Herbicide",
# "0NSPYHERB" = "Herbicide Only",
# "0YSPNHERB" = "Salvage Only",
# "0NSPNHERB" = "No Treatment"))
δ13C Light Boxplot
data.light %>%
ggplot(aes(x=Treatment, y = Light)) +
geom_boxplot() +
labs(title = "Treatment Effects on Light Availability", y = "Light Availability (% Trans. Total)")+
scale_x_discrete(labels = c("0YSPYHERB" = "Salvage+Herbicide",
"0NSPYHERB" = "Herbicide",
"0YSPNHERB" = "Salvage",
"0NSPNHERB" = "No Treatment"),
guide = guide_axis(angle = -45))
Survival Rate Bar Chart
data.survival %>%
ggplot(aes(x=Treatment, y=Survival)) +
geom_col() +
facet_wrap(~Species) +
labs(title = "Treatment Effects on Survival by Species", y = "Survival Rate (%)")+
scale_x_discrete(labels = c("Treatment 1" = "Salvage+Herbicide",
"Treatment 2" = "Herbicide",
"Treatment 3" = "Salvage",
"Treatment 4" = "No Treatment"),
guide = guide_axis(angle = -45))
Ignore for now - Linear Regression on Height
# Assuming your dataframe is named data
# Run linear regression
model <- lm(Height ~ Species + Treatment, data = data)
# Print summary of the regression results
summary(model)
##
## Call:
## lm(formula = Height ~ Species + Treatment, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.8935 -2.9687 0.0696 2.8361 14.0696
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 31.9837 0.8577 37.292 < 2e-16 ***
## SpeciesPP 1.2637 0.7741 1.632 0.1040
## SpeciesSP -9.2747 0.6930 -13.383 < 2e-16 ***
## Treatment0NSPYHERB -1.2786 0.8516 -1.501 0.1347
## Treatment0YSPNHERB -1.5901 0.8619 -1.845 0.0664 .
## Treatment0YSPYHERB -5.9328 0.9279 -6.394 9.5e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.252 on 221 degrees of freedom
## (23 observations deleted due to missingness)
## Multiple R-squared: 0.6209, Adjusted R-squared: 0.6123
## F-statistic: 72.38 on 5 and 221 DF, p-value: < 2.2e-16
plot(model)