Calculates the Wald test statistic for a single parameter.
wald_test(thetahat, varhat, null = 0)
thetahat | Numeric. Parameter estimate \(\left( \hat{\theta} \right)\). |
---|---|
varhat | Numeric.
Estimated variance of |
null | Numeric.
Hypothesized value of |
Returns a vector with the following elements:
Wald test statistic.
p-value.
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
.
Other Wald test functions:
sqrt_wald_test()
thetahat <- 0.860 sehat <- 0.409 varhat <- sehat^2 wald_test( thetahat = thetahat, varhat = varhat )#> statistic p #> 4.42130308 0.07098584