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 = "all", checkEstimability = TRUE, ...)
model |
a model object of class "gnm" |
estimate |
specifies non-eliminated parameters or linear
combinations of parameters for which to find standard errors. In the
first case either "all" , a character vector of names, a
numeric vector of indices or "pick" 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 . |
checkEstimability |
logical: should the estimability of all specified combinations be checked? |
... |
possible further arguments for
checkEstimable |
A data frame with two columns:
estimate |
The estimated parameter combinations |
SE |
Their estimated standard errors |
and row names the same as the column names (if any) of coefMatrix
.
In the case where estimate
is a numeric vector, se
will
assume indices have been specified if all the values of
estimate
are in 1:(length(coef(model)) - model$eliminate)
.
David Firth
gnm
, getContrasts
,
checkEstimable
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)) ## Deviance is 200.3 ## Get estimate and se for the contrast between educ4 and educ5 in the ## UNIDIFF multiplier educ4.pos <- grep("Mult.*educ4", names(coef(unidiff))) mycontrast <- rep(0, length(coef(unidiff))) mycontrast[educ4.pos] <- 1 mycontrast[educ4.pos + 1] <- -1 se(unidiff, mycontrast) ## Get all of the contrasts with educ5 in the UNIDIFF multipliers getContrasts(unidiff, rev(grep("Mult.*educ", names(coef(unidiff)))))