Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ofInterest

Coefficients of Interest in a Generalized Nonlinear Model


Description

Retrieve or set the "ofInterest" component of a "gnm" (generalized nonlinear model) object.

Usage

ofInterest(object)
ofInterest(object) <- value

Arguments

object

an object of class "gnm".

value

a numeric vector of indices specifying the subset of (non-eliminated) coefficients of interest, or NULL to specify that all non-eliminated coefficients are of interest.

Details

The "ofInterest" component of a "gnm" object is a named numeric vector of indices specifying a subset of the non-eliminated coefficients which are of specific interest.

If the "ofInterest" component is non-NULL, printed summaries of the model only show the coefficients of interest. In addition methods for "gnm" objects which may be applied to a subset of the parameters are by default applied to the coefficients of interest.

These functions provide a way of extracting and replacing the "ofInterest" component. The replacement function prints the replacement value to show which parameters have been specified by value.

Value

A named vector of indices, or NULL.

Note

Regular expression matching is performed using grep with default settings.

Author(s)

Heather Turner

See Also

Examples

set.seed(1)

## Fit the "UNIDIFF" mobility model across education levels
unidiff <- gnm(Freq ~ educ*orig + educ*dest +
               Mult(Exp(educ), orig:dest),
               ofInterest = "[.]educ", family = poisson,
               data = yaish,  subset = (dest != 7))
ofInterest(unidiff)

## Get all of the contrasts with educ1 in the UNIDIFF multipliers
getContrasts(unidiff, ofInterest(unidiff))

## Get estimate and se for the contrast between educ4 and educ5 in the
## UNIDIFF multiplier
mycontrast <- numeric(length(coef(unidiff)))
mycontrast[ofInterest(unidiff)[4:5]] <- c(1, -1)
se(unidiff, mycontrast)

gnm

Generalized Nonlinear Models

v1.1-1
GPL-2 | GPL-3
Authors
Heather Turner [aut, cre] (<https://orcid.org/0000-0002-1256-3375>), David Firth [aut] (<https://orcid.org/0000-0003-0302-2312>), Brian Ripley [ctb], Bill Venables [ctb], Douglas M. Bates [ctb], Martin Maechler [ctb] (<https://orcid.org/0000-0002-8685-9910>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.