df_for_wald: Gets the degree of freedom for Wald tests involving the model

Description Usage Arguments Details Value Methods (by class) See Also Examples

View source: R/main.R

Description

This generic function is used by p_value_contrast.default to get the number of degrees of freedom of the t distribution that approximates the point estimate of the contrast divided by its standard error.

Usage

1
2
3
4
5
6
7
df_for_wald(object, ...)

## S3 method for class 'glm'
df_for_wald(object, ...)

## Default S3 method:
df_for_wald(object, ...)

Arguments

object

statistical model;

...

Unused by p_value_contrast.default, but may be useful to some custom specializations.

Details

This function is quite similar to df.residual but it should return Inf when the Student's t distribution is less appropriate than the normal distribution.

Value

A finite value or Inf for normal distribution approximation.

Methods (by class)

See Also

Other Wald-related functions: fixcoef(), p_value_contrast(), vcov_fixcoef()

Examples

1
2
3
4
5
6
7
# 10 observations, one coefficient, 9 degrees of freedom
df_for_wald(glm(I(1:10) ~ 1))
# returns Inf (non-gaussian-identity model)
df_for_wald(glm(family="poisson", c(10,20,30) ~ 1))
data(mtcars)
# returns Inf (non-gaussian-identity model)
df_for_wald(glm(family="binomial", data=mtcars, I(hp > median(hp)) ~ cyl))

glmglrt documentation built on Aug. 7, 2020, 9:10 a.m.

Related to df_for_wald in glmglrt...