# Test whether a regression coefficient differs from zero
# Suppose we estimated beta = 2.5 with SE = 0.8
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
# H0: theta = 2 vs H1: theta != 2
wald_test(estimate = 2.5, se = 0.8, null_value = 2)
Run the code above in your browser using DataLab