faulty power analysis
This commit is contained in:
parent
48d1be7bf8
commit
48d4ea2851
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user