running into issues in powerCheck
This commit is contained in:
parent
cce8a8ba68
commit
343b623891
@ -25,6 +25,7 @@ data2 <- read_csv('/data_ext/users/kcz1100/kaylea_dissertation/collabnetXS/raw_d
|
|||||||
#levels(d$source) <- c("IP-based Editors", "New Editors", "Registered Editors", "Tor-based Editors")
|
#levels(d$source) <- c("IP-based Editors", "New Editors", "Registered Editors", "Tor-based Editors")
|
||||||
|
|
||||||
data1$up.fac.mean <- as.numeric(data2$up.fac.mean[match(data1$pkg, data2$pkg)])
|
data1$up.fac.mean <- as.numeric(data2$up.fac.mean[match(data1$pkg, data2$pkg)])
|
||||||
|
data1$milestones <- as.numeric(data1$milestones > 0) + 1
|
||||||
# (2) - Run the model on the pilot data
|
# (2) - Run the model on the pilot data
|
||||||
pilotM <- glm(up.fac.mean ~ ((mmt) / (milestones/age)), # give the anticipated regression a try
|
pilotM <- glm(up.fac.mean ~ ((mmt) / (milestones/age)), # give the anticipated regression a try
|
||||||
family=gaussian(link='identity'), data=data1)
|
family=gaussian(link='identity'), data=data1)
|
||||||
|
@ -41,9 +41,9 @@ powerCheck <- function(n, nSims) { #run a power calculation on the dataset given
|
|||||||
m1.sim <- glm(up.fac.mean ~ ((mmt)/ (milestones/age)), # give the anticipated regression a try
|
m1.sim <- glm(up.fac.mean ~ ((mmt)/ (milestones/age)), # give the anticipated regression a try
|
||||||
family=gaussian(link='identity'), data=simData)
|
family=gaussian(link='identity'), data=simData)
|
||||||
p0 <- coef(summary(m1.sim))[1,4]
|
p0 <- coef(summary(m1.sim))[1,4]
|
||||||
p1 <- coef(summary(m1.sim))[2,4]
|
p1 <- coef(summary(m1.sim))[1,4]
|
||||||
p2 <- coef(summary(m1.sim))[3,4]
|
p2 <- coef(summary(m1.sim))[1,4]
|
||||||
p3 <- coef(summary(m1.sim))[4,4]
|
p3 <- coef(summary(m1.sim))[1,4]
|
||||||
signif0[s] <- p0 <=.05
|
signif0[s] <- p0 <=.05
|
||||||
signif1[s] <- p1 <=.05
|
signif1[s] <- p1 <=.05
|
||||||
signif2[s] <- p2 <=.05
|
signif2[s] <- p2 <=.05
|
||||||
|
Loading…
Reference in New Issue
Block a user