## 200 variables, hence 200 univariate regressions are to be fitted
x <- matrix( rnorm(100 * 200), ncol = 200 )
y <- rbinom(100, 1, 0.6) ## binary logistic regression
system.time( univglms(y, x) )
a1 <- univglms(y, x)
system.time( score.glms(y, x) )
a2 <- score.glms(y, x)
cor(a1, a2)
mean(a1 - a2)
#x <- matrix( rnorm(1000 * 2000), ncol = 2000 )
#y <- rbinom(1000, 1, 0.6) ## binary logistic regression
#a1 <- univglms(y, x)
#a2 <- score.glms(y, x)
#cor(a1, a2)
#mean(a1 - a2)
## x <- matrix( rnorm(500 * 2000), ncol = 2000 )
## y <- rbinom(500, 3, 0.5)
## a <- score.multinomregs(y, x)
## hist(a[, 2])
## sum(a < 0.05) / 2000 ## estimated type I error
Run the code above in your browser using DataLab