running into issues in powerCheck

This commit is contained in:
Matthew Gaughan 2023-11-10 12:00:45 -06:00
parent cce8a8ba68
commit 343b623891
2 changed files with 4 additions and 3 deletions

View File

@ -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")
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
pilotM <- glm(up.fac.mean ~ ((mmt) / (milestones/age)), # give the anticipated regression a try
family=gaussian(link='identity'), data=data1)

View File

@ -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
family=gaussian(link='identity'), data=simData)
p0 <- coef(summary(m1.sim))[1,4]
p1 <- coef(summary(m1.sim))[2,4]
p2 <- coef(summary(m1.sim))[3,4]
p3 <- coef(summary(m1.sim))[4,4]
p1 <- coef(summary(m1.sim))[1,4]
p2 <- coef(summary(m1.sim))[1,4]
p3 <- coef(summary(m1.sim))[1,4]
signif0[s] <- p0 <=.05
signif1[s] <- p1 <=.05
signif2[s] <- p2 <=.05