
```{r config, warning = FALSE, message=FALSE}
library(simr)

setwd("~/Box Sync/LCNL Box Folder/Studies_Hopman/Hopman-ALL study (FYP Elise)/OSF data and analysis")
load(file = "WorkspaceInclJoVE.Rdata")

# note that this workspace follows up on environment you get from running the Analysis.Rmd and AnalysisJoVEEffectSize.Rmd scripts, 
# that's where all models (e.g. mFCRTV come from)
# post-hoc power analysis based on Brysbaert & Stevens 2018 article 
# for the Hopman & MacDonald, 2018 Psychological Science paper
# and the Hopman, Ludin & MacDonald JoVE paper

nrsims = 400

powerFCACA <- powerSim(mFCACA,test = fixed('learningCondition'), nsim = nrsims)
powerFCACA

powerEMACA <- powerSim(mEMACA2,test = fixed('learningCondition'), nsim = nrsims)
powerEMACA 

powerFCRTV <- powerSim(mFCRTV,test = fixed('learningCondition'), nsim = nrsims)
powerFCRTV 

powerFCRTA <- powerSim(mFCRTA,test = fixed('learningCondition'), nsim = nrsims)
powerFCRTA

powerFCRTP <- powerSim(mFCRTP,test = fixed('learningCondition'), nsim = nrsims)
powerFCRTP 

powerEMRTW <- powerSim(mEMRTW,test = fixed('learningCondition'), nsim = nrsims)
powerEMRTW 

powerEMRTA <- powerSim(mEMRTA,test = fixed('learningCondition'), nsim = nrsims)
powerEMRTA 

powerEMRTP <- powerSim(mEMRTP,test = fixed('learningCondition'), nsim = nrsims)
powerEMRTP 


save.image(file = "WorkspaceJoVEPower.Rdata")
```
