source("Homework_09Functions.R")
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Warning: `data_frame()` was deprecated in tibble 1.1.0.
## ℹ Please use `tibble()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
#Set global variables
nName<- c("Ambient","Drought","Lush") #Names of treatments
nSize <- c(30,30, 65)
nMean <- c(0.103697, 0.03247, 0.2344)
nSD <-c(0.0565, 0.00656, 0.13)

Run the analysis

Each run of the code generates a random data set using the “FakeDataGeneration” function and follows a normal distribution.

DataSet<-FakeDataGeneration()

print(head(DataSet))
## # A tibble: 6 × 3
##   Index Treatment  Value
##   <int> <chr>      <dbl>
## 1     1 Ambient   0.143 
## 2     2 Ambient   0.120 
## 3     3 Ambient   0.103 
## 4     4 Ambient   0.0311
## 5     5 Ambient   0.0672
## 6     6 Ambient   0.193
print(AnoStats(DataSet))
## [[1]]
## [[1]]$AverageofTreatments
##   Treatment      Value
## 1   Ambient 0.11043440
## 2   Drought 0.03534224
## 3      Lush 0.21980985
## 
## [[1]]$Fval
## F value1 
## 32.54127 
## 
## [[1]]$probF
##      Pr(>F)1 
## 4.719768e-12 
## 
## 
## [[2]]

Modify the analysis

Alongside this, the code provides the ability to adjust sample size, means, standard deviations, and treatment numbers at will.

nName<- c("Ambient", "Drought", "Lush", "Arid")
nMean<- c(0.1037,0.0325,0.2344, 0.0766)
nSD<- c(0.0565, 0.00656, 0.023, 0.00876)
nSize<-c(50,50,50,50)

Dataset<-FakeDataGeneration()
print(head(Dataset))
## # A tibble: 6 × 3
##   Index Treatment  Value
##   <int> <chr>      <dbl>
## 1     1 Ambient   0.0534
## 2     2 Ambient   0.195 
## 3     3 Ambient   0.0908
## 4     4 Ambient   0.143 
## 5     5 Ambient   0.179 
## 6     6 Ambient   0.217
print(AnoStats(Dataset))
## [[1]]
## [[1]]$AverageofTreatments
##   Treatment      Value
## 1   Ambient 0.10843029
## 2      Arid 0.07618662
## 3   Drought 0.03238816
## 4      Lush 0.22662423
## 
## [[1]]$Fval
## F value1 
## 403.9833 
## 
## [[1]]$probF
##      Pr(>F)1 
## 1.250468e-83 
## 
## 
## [[2]]