sqrt_wald_test: Square Root of the Wald Test Statistic for a Single Parameter

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/wald.R

Description

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

Usage

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

Arguments

thetahat

Numeric. Parameter estimate ≤ft( \hat{θ} \right).

sehat

Numeric. Estimated standard error of thetahat ≤ft( \widehat{\mathrm{se}} ≤ft( \hat{θ} \right) \right).

null

Numeric. Hypothesized value of theta ≤ft( θ_{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".

Details

The square root of the Wald test statistic for a single parameter is calculated as follows:

√{W} = \frac{ \hat{θ} - θ_0 } { \widehat{\mathrm{se}} ≤ft( \hat{θ} \right) } .

The associated p-value from the z or t distribution is calculated using pnorm() or pt().

Value

Returns a vector with the following elements:

statistic

Square root of Wald test statistic.

p

p-value.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Wald test

See Also

Other Wald test functions: wald_test()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
thetahat <- 0.860
sehat <- 0.409
sqrt_wald_test(
  thetahat = thetahat,
  sehat = sehat
)
sqrt_wald_test(
  thetahat = thetahat,
  sehat = sehat,
  dist = "t",
  df = 1000
)

jeksterslabds/jeksterslabRboot documentation built on July 20, 2020, 12:56 p.m.