se {gnm}R Documentation

Standard Errors of Linear Parameter Combinations in gnm Models

Description

Computes approximate standard error for 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.

Usage

se(model, coefMatrix, checkEstimability = TRUE, ...)

Arguments

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.
checkEstimability logical: should the estimability of all specified combinations be checked?
... possible further arguments for checkEstimable

Value

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.

Author(s)

David Firth

See Also

gnm, getContrasts, checkEstimable

Examples

data(yaish)
set.seed(1)

## 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)
## Deviance is 208.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, grep("Mult.*educ", names(coef(unidiff))))

[Package gnm version 0.6-1 Index]