Learn R Programming

gnm (version 0.8-1)

checkEstimable: Check Whether One or More Parameter Combinations in a gnm Model are Identified

Description

For each of a specified set of linear combinations of parameters from a gnm model, checks numerically whether the combination's estimate is invariant to re-parameterization of the model.

Usage

checkEstimable(model, coefMatrix, tolerance = 1e-8)

Arguments

model
a model object of class "gnm"
coefMatrix
numeric: either a vector of length the same as length(coef(model)), or a matrix with that number of rows. Coefficients of one or more linear combinations of the model's parameters.
tolerance
numeric: a threshold value for detection of non-estimability.

Value

  • A logical vector of length equal to the number of parameter combinations tested; NA where a parameter combination is identically zero.

References

Catchpole, E.A. and Morgan, B.J.T. (1997). Detecting parameter redundancy. Biometrika, 84, 187--196.

See Also

gnm, se, getContrasts

Examples

Run this code
data(yaish)
set.seed(1)

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

## Check whether Mult1.Factor1.educ4 - Mult1.Factor1.educ5 is estimable
educ4.pos <- grep("Mult1.Factor1.educ4", names(coef(unidiff)))
checkEstimable(unidiff, c(rep(0, educ4.pos - 1), 1, -1,
                          rep(0, length(coef(unidiff)) - educ4.pos - 1)))
## should be TRUE

## Check whether Mult1.Factor1.educ4 itself is estimable
checkEstimable(unidiff, c(rep(0, educ4.pos - 1), 1, 0,
                          rep(0, length(coef(unidiff)) - educ4.pos - 1)))
## should be FALSE -- only *differences* are identified here

Run the code above in your browser using DataLab