diff --git a/R/powerAnalysis.R b/R/powerAnalysis.R index 3c7d440..f4f205c 100644 --- a/R/powerAnalysis.R +++ b/R/powerAnalysis.R @@ -17,14 +17,8 @@ l2p <- function(b) { #Matt: makeDataNew <- function(n) { sDF <- data.frame( - sample(2793.638:3066.417, 1, replace = FALSE), - sample(27.6519:154.6866, 1, replace = FALSE), - sample(50.01884:96.77090, 1, replace = FALSE), - sample(c(1,2), 1, prob=(c(0.5,0.5)), replace = FALSE), - sample(1.610638: 1.684438, 1, replace = FALSE), - sample(-0.1961401:-0.1647757, 1, replace = FALSE) ) - colnames(sDF) <- c('age', 'contributors', 'collaborators', 'milestones', 'mmt', 'up.fac.mean') + colnames(sDF) <- c('formality', 'age', 'contributors', 'collaborators', 'milestones', 'mmt', 'up.fac.mean') return(sDF) } @@ -38,8 +32,7 @@ powerCheck <- function(n, nSims) { #run a power calculation on the dataset given for (s in 1:nSims) { # repeatedly we will.... simData <- makeDataNew(n) # make some data #have updated for kkex through here, now need to look at the underproduction work - m1.sim <- glm(up.fac.mean ~ ((mmt)/ (milestones/age)), # give the anticipated regression a try - family=gaussian(link='identity'), data=simData) + m1.sim <- lm(up.fac.mean ~ ((mmt)/ (milestones/age)), data=simData) p0 <- coef(summary(m1.sim))[1,4] p1 <- coef(summary(m1.sim))[1,4] p2 <- coef(summary(m1.sim))[1,4]