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 last parameter in the set, and estimated standard
errors for those estimated differences.
getContrasts(model, sets = NULL, nSets = 1, ...)
model |
a model object of class "gnm" |
sets |
a vector of indices (if nSets is 1) or
a list (of length nSets ) of such vectors |
nSets |
the number of vectors of indices to use |
... |
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 last coefficient and their standard errors are computed. A check is performed first on the estimability of all such differences.
A list (of length nSets
) of 2-component lists. The first
component, named summary
, is a data frame containing variables
estimate
, se
and quasi.se
. The quasi.se
variable is
not present if either the qvcalc
package is unavailable
or there are fewer than two estimable differences. The second
component, named relative.errors
, is a character vector
of length 2 containing the smallest and largest relative errors of the
quasi-standard-error approximation, in the set of all simple
contrasts; or NULL
if quasi standard errors have not been
calculated. See Firth (2003) or Firth and Menezes (2004)
for details of quasi standard errors and their use.
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
set.seed(1) data(yaish) ## Fit the "UNIDIFF" mobility model across education levels unidiff <- gnm(Freq ~ educ:orig + educ:dest + Mult(Exp(-1 + educ), orig:dest), family = poisson, data = yaish) ## Examine the education multipliers (differences on the log scale): getContrasts(unidiff, grep("Mult1.Factor1", names(coef(unidiff))))