getContrasts {gnm} | R Documentation |
For each set in a specified list of sets of parameters from a
gnm
model, computes the estimated simple contrasts (i.e.,
differences) with the first parameter in the set, and estimated standard
errors for those estimated differences. Where possible, quasi standard
errors are also computed.
getContrasts(model, sets = NULL, nSets = 1, dispersion = NULL, use.eliminate = TRUE, ...)
model |
a model object of class "gnm" . |
sets |
a vector of indices or
a list of such vectors. If NULL , a Tk
dialog will open for parameter selection. |
nSets |
the number of vectors of indices to use when
sets is NULL . |
dispersion |
either NULL , or a positive number by which
the model's variance-covariance matrix should be scaled. |
use.eliminate |
logical; see vcov.gnm |
... |
arguments to pass to other functions. |
The indices must all be in 1:length(coef(object))
. If
sets = NULL
, a Tk dialog is presented for the selection
of indices (model coefficients).
For each set of coefficients selected, differences with the first coefficient and their standard errors are computed. A check is performed first on the estimability of all such differences.
If sets
is non-NULL
, the value of the nsets
argument is ignored.
EITHER a list (normally of length nSets
) of objects of class
qv
— see qvcalc
— (when sets
is a list, or when sets
is NULL
and nSets > 1
);
OR an object of class qv
(otherwise).
David Firth
Firth, D (2003). Overcoming the reference category problem in the presentation of statistical models. Sociological Methodology 33, 1–18.
Firth, D and Menezes, R X de (2004). Quasi-variances. Biometrika 91, 65–80.
gnm
, se
,
checkEstimable
, qvcalc
,
ofInterest
set.seed(1) data(yaish) ## Fit the "UNIDIFF" mobility model across education levels -- see ?yaish unidiff <- gnm(Freq ~ educ*orig + educ*dest + Mult(Exp(educ), orig:dest), ofInterest = "[.]educ", family = poisson, data = yaish, subset = (dest != 7)) ## Examine the education multipliers (differences on the log scale): unidiffContrasts <- getContrasts(unidiff, ofInterest(unidiff)) plot(unidiffContrasts, main = "Unidiff multipliers (log scale): intervals based on quasi standard errors", xlab = "Education level", levelNames = 1:5)