# Univariate: test whether a regression coefficient differs from zero
w <- wald_test(estimate = 2.5, se = 0.8, null_value = 0)
w
# Extract components
test_stat(w) # Wald statistic (chi-squared)
w$z # z-score
pval(w) # p-value
is_significant_at(w, 0.05)
# Test against a non-zero null
wald_test(estimate = 2.5, se = 0.8, null_value = 2)
# Multivariate: test two parameters jointly
est <- c(2.0, 3.0)
V <- matrix(c(1.0, 0.3, 0.3, 1.0), 2, 2)
w_mv <- wald_test(estimate = est, vcov = V, null_value = c(0, 0))
test_stat(w_mv)
dof(w_mv) # 2
pval(w_mv)
Run the code above in your browser using DataLab