checkEstimable {gnm} | R Documentation |
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.
checkEstimable(model, coefMatrix, tolerance = 1e-8)
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. |
A logical vector of length equal to the number of parameter combinations
tested; NA
where a parameter combination is identically zero.
David Firth
Catchpole, E.A. and Morgan, B.J.T. (1997). Detecting parameter redundancy. Biometrika, 84, 187–196.
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