install.packages(“boot”) library(boot)

Means and SDs from actual data

# sd(wit$White.Oak) = 0.1629188
# mean(wit$White.Oak) = 0.1364748
# sd(fia$whiteOak) = 0.9191958
# mean(fia$whiteOak) = 0.1752141

Simulating Pre-Colonization data (n=1000)

wit <- rnorm(n=2000, mean=0.136, sd=0.163)
wit <- wit[wit >= 0]
wit <- wit[1:1000]

Simulating Post-Colonization data (n=1000)

fia <- rnorm(n=3000, mean=0.175, sd=0.919)
fia <- fia[fia >= 0]
fia <- fia[fia <= 1]
fia <- fia[1:1000]
par(mfrow=c(1,2))
p1 <- hist(wit)
p2 <- hist(fia)

Paired T-test

t.test(wit, fia, paired = TRUE, alternative = "two.sided")
## 
##  Paired t-test
## 
## data:  wit and fia
## t = -26.968, df = 999, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.2821539 -0.2438770
## sample estimates:
## mean of the differences 
##              -0.2630155

Because the variance is so different between groups, means can be the same and still be significantly different

Simulating Pre-Colonization data (n=1000)

wit <- rnorm(n=2000, mean=0.136, sd=0.163)
wit <- wit[wit >= 0]
wit <- wit[1:1000]

Simulating Post-Colonization data (n=1000)

fia <- rnorm(n=3000, mean=0.136, sd=0.919)
fia <- fia[fia >= 0]
fia <- fia[fia <= 1]
fia <- fia[1:1000]
par(mfrow=c(1,2))
p1 <- hist(wit)
p2 <- hist(fia)

Paired T-test

t.test(wit, fia, paired = TRUE, alternative = "two.sided")
## 
##  Paired t-test
## 
## data:  wit and fia
## t = -27.533, df = 999, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.2837163 -0.2459643
## sample estimates:
## mean of the differences 
##              -0.2648403

n=15 was the lowest sample size to still be significant

Simulating Pre-Colonization data (n=15)

wit <- rnorm(n=2000, mean=0.136, sd=0.163)
wit <- wit[wit >= 0]
wit <- wit[1:15]

Simulating Post-Colonization data (n=15)

fia <- rnorm(n=3000, mean=0.175, sd=0.919)
fia <- fia[fia >= 0]
fia <- fia[fia <= 1]
fia <- fia[1:15]
par(mfrow=c(1,2))
p1 <- hist(wit)
p2 <- hist(fia)

Paired T-test

t.test(wit, fia, paired = TRUE, alternative = "two.sided")
## 
##  Paired t-test
## 
## data:  wit and fia
## t = -4.2886, df = 14, p-value = 0.0007498
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.4818081 -0.1605565
## sample estimates:
## mean of the differences 
##              -0.3211823