set.seed(1)
data(yaish)
## 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))
## Examine the education multipliers (differences on the log scale):
ofInterest <- grep("Mult1.Factor1", names(coef(unidiff)))
educMultipliers <- getContrasts(unidiff, rev(ofInterest))[[1]]
## Now get the same standard errors using a suitable set of
## quadratic forms, by calling vcov() directly:
cmat <- contr.sum(ofInterest)
sterrs <- sqrt(diag(t(cmat)
                     %*% vcov(unidiff)[ofInterest, ofInterest]
                     %*% cmat))
all(sterrs == (educMultipliers$SE)[-1]) ## TRUERun the code above in your browser using DataLab