se {gnm} | R Documentation |
Computes approximate standard errors for (a selection of) individual
parameters or one or more linear combinations of the parameters in a
gnm
(generalized nonlinear model) object. By default, a
check is made first on the estimability of each specified combination.
se(model, estimate = ofInterest(model), checkEstimability = TRUE, Vcov = NULL, dispersion = NULL, ...)
model |
a model object of class "gnm" . |
estimate |
(optional) specifies parameters or linear
combinations of parameters for which to find standard errors. In the
first case either a character vector of names, a
numeric vector of indices or "[?]" to select from a Tk
dialog. In the second case coefficients given as a vector or the
rows of a matrix, such that NROW(estimate) is equal to
length(coef(model)) or length(coef(model)) -
model$eliminate . If missing, standard errors are returned for all
parameters in the model. |
checkEstimability |
logical: should the estimability of all specified combinations be checked? |
Vcov |
either NULL, or a matrix |
dispersion |
either NULL, or a positive number |
... |
possible further arguments for
checkEstimable . |
A data frame with two columns:
Estimate |
The estimated parameter combinations |
Std. Error |
Their estimated standard errors |
If available, the column names of coefMatrix
will be used to name
the rows.
In the case where estimate
is a numeric vector, se
will
assume that indices have been specified if all the values of
estimate
are in seq(length(coef(model))
.
Where both Vcov
and dispersion
are supplied, the
variance-covariance matrix of estimated model coefficients is taken to
be Vcov * dispersion
.
David Firth
gnm
, getContrasts
,
checkEstimable
, ofInterest
data(yaish) 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)) ## Deviance is 200.3 ## 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) ## Get all of the contrasts with educ5 in the UNIDIFF multipliers getContrasts(unidiff, rev(ofInterest(unidiff)))