Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.29 KB | None | 0 0
  1. runs <- 1000
  2. nn <- 100
  3. set.seed(2010)
  4. detections <- replicate(n=runs,expr={covariate <- runif(nn); outcome <- runif(nn)<1/(1+exp(-2*log(2)*covariate+rnorm(nn)))
  5. summary(glm(outcome~covariate,family="binomial"))$coefficients["covariate","Pr(>|z|)"] < .05}) cat("Power:",sum(detections)/runs,"\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement