Learn R Programming

VGAM (version 1.0-4)

lrp: Likelihood ratio p-values

Description

Returns a vector of p-values from testing whether each estimated coefficient of a VGLM regression model is 0 or not. The methodology is based on a likelihood ratio test.

Usage

lrp(object, ...)
lrp.vglm(object, which = NULL, omit1s = TRUE,
         trace = NULL, ...)

Arguments

object

A vglm object.

which

Numeric or character. Specifies which regression coefficient are to be selected. The default is to select them all, except the intercepts.

trace

Logical. If TRUE then some output is produced as each regression coefficient is deleted (set to 0) and the IRLS iterations proceed. The default is to use the trace value of the fitted object; see vglm.control.

omit1s

Logical. If TRUE (the default) then regression coefficients deriving from the intercept term are not selected. This is because, for some models such as propodds and cumulative, setting an intercept equal to 0 does not make much sense.

further arguments passed into the other methods functions.

Value

By default, a vector of (2-sided test) p-values. If the model is intercept-only then a NULL is returned by default.

Warning

This function has not yet been thoroughly tested. Convergence failure is possible for some models applied to certain data sets; it is a good idea to set trace = TRUE to monitor convergence.

Details

When summary() is applied to a vglm object a Wald table is produced. The corresponding p-values are generally viewed as inferior to those from a likelihood ratio test (LRT). For example, the Hauck and Donner (1977) effect (HDE) produces p-values that are biased upwards (see hdeff). Other reasons are that the Wald test is often less accurate (especially in small samples) and is not invariant to parameterization. This function returns p-values based on the LRT by deleting one column at a time from the big VLM matrix and then starting up IRLS to convergence (hopefully). Twice the difference between the log-likelihoods (or equivalently, the difference in the deviances if they are defined) is asymptotically chi-squared with 1 degree of freedom. One might expect the p-values from this function therefore to be more accurate and not suffer from the HDE. Thus this function is an alternative to summaryvglm for testing for the significance of a regression coefficient.

See Also

hdeff, summaryvglm, vglm, confintvglm, pchisq, profilevglm.

Examples

Run this code
# NOT RUN {
pneumo <- transform(pneumo, let = log(exposure.time))
fit <- vglm(cbind(normal, mild, severe) ~ let, propodds, data = pneumo)
cbind(coef(summary(fit)),
      "LRT pvalue" = lrp(fit, omit1s = FALSE))
# }

Run the code above in your browser using DataLab