Last chance! 50% off unlimited learning
Sale ends in
vglm
in the
blogits(Y, add, colnames, row.vars, rev=FALSE)
any(Y)==0
and 0 otherwise.c("logit1", "logit2", "logOR")
. If less than three
names are supplied, the remaining ones are filled in from the default.Y
Y
should be reversed.nrow(Y)
rows and 3 + ncol(row.vars)
columnsY
are given in the order
11, 10, 01, 00, so the logits give the log odds of the 1 response
compared to 0.
If this is not the case, either use rev=TRUE
or supply
Y[,4:1]
as the first argument.vglm
data(Toxaemia)
tox.tab <- xtabs(Freq~class + smoke + hyper + urea, Toxaemia)
# reshape to 4-column matrix
toxaemia <- t(matrix(aperm(tox.tab), 4, 15))
colnames(toxaemia) <- c("hu", "hU", "Hu", "HU")
rowlabs <- expand.grid(smoke=c("0", "1-19", "20+"), class=factor(1:5))
toxaemia <- cbind(toxaemia, rowlabs)
# logits for H and U
logitsTox <- blogits(toxaemia[,4:1], add=0.5, colnames=c("logitH", "logitW"), row.vars=rowlabs)
logitsTox
Run the code above in your browser using DataLab