Calculates the Wald test statistic for a single parameter.

wald_test(thetahat, varhat, null = 0)

Arguments

thetahat

Numeric. Parameter estimate \(\left( \hat{\theta} \right)\).

varhat

Numeric. Estimated variance of thetahat \(\left( \widehat{\mathrm{Var}} \left( \hat{\theta} \right) \right)\).

null

Numeric. Hypothesized value of theta \(\left( \theta_{0} \right)\). Set to zero by default.

Value

Returns a vector with the following elements:

statistic

Wald test statistic.

p

p-value.

Details

The Wald test statistic for a single parameter is calculated as follows: $$ W = \frac{ \left( \hat{\theta} - \theta_0 \right)^2 } { \widehat{\mathrm{Var}} \left( \hat{\theta} \right) } $$ The associated p-value from the chi-square distribution is calculated using pchisq() with df = 1.

References

Wikipedia: Wald test

See also

Other Wald test functions: sqrt_wald_test()

Examples

thetahat <- 0.860 sehat <- 0.409 varhat <- sehat^2 wald_test( thetahat = thetahat, varhat = varhat )
#> statistic p #> 4.42130308 0.07098584