set.seed(123)
n <- 100
y <- rbinom(n, 1, 0.5)
x <- runif(n*5)
dim(x) <- c(n, 5)
x <- data.frame(x)
colnames(x) <- c("x", "x2", "x3", "z", "z2")
fit <- glm(y ~ ., data=x, family=binomial())
# Chi-squared test
getWaldTest(fit, c("x", "z"))
beta <- c(-2.5, 2.5)
cov <- diag(1:2)
getWaldTest(list(parms=beta, cov=cov), 1:2)
Run the code above in your browser using DataLab