Calculates the square root of the Wald test statistic for a single parameter.

sqrt_wald_test(thetahat, sehat, null = 0, dist = "z", df)

Arguments

thetahat

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

sehat

Numeric. Estimated standard error of thetahat \(\left( \widehat{\mathrm{se}} \left( \hat{\theta} \right) \right)\).

null

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

dist

Character string. dist = "z" for the standard normal distribution. dist = "t" for the t distribution.

df

Numeric. Degrees of freedom (df) if dist = "t". Ignored if dist = "z".

Value

Returns a vector with the following elements:

statistic

Square root of Wald test statistic.

p

p-value.

Details

The square root of the Wald test statistic for a single parameter is calculated as follows: $$ \sqrt{W} = \frac{ \hat{\theta} - \theta_0 } { \widehat{\mathrm{se}} \left( \hat{\theta} \right) } . $$ The associated p-value from the z or t distribution is calculated using pnorm() or pt().

References

Wikipedia: Wald test

See also

Other Wald test functions: wald_test()

Examples

thetahat <- 0.860 sehat <- 0.409 sqrt_wald_test( thetahat = thetahat, sehat = sehat )
#> statistic p #> 2.10268949 0.03549292
sqrt_wald_test( thetahat = thetahat, sehat = sehat, dist = "t", df = 1000 )
#> statistic p #> 2.10268949 0.03574239