loglinb3 {VGAM} | R Documentation |
Fits a loglinear model to three binary responses.
loglinb3(exchangeable = FALSE, zero = NULL)
exchangeable |
Logical.
If TRUE , the three marginal probabilities are constrained to
be equal. |
zero |
Which linear/additive predictor is modelled as an
intercept only? A NULL means none. |
The model is P(Y1=y1,Y2=y2,Y3=y3) =
exp(u0 + u1*y1 + u2*y2 + u3*y3 + u12*y1*y2 + u13*y1*y3+ u23*y2*y3)
where y1, y2 and y3 are 0 or 1, and the parameters are u1, u2, u3, u12, u13, u23. The normalizing parameter u0 can be expressed as a function of the other parameters. Note that a third-order association parameter, u123 for the product y1*y2*y3, is assumed to be zero for this family function.
The linear/additive predictors are (eta1,eta2,...,eta6) = (u1,u2,u3,u12,u13,u23).
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
rrvglm
and vgam
.
When fitted, the fitted.values
slot of the object contains the
eight joint probabilities, labelled as (Y1,Y2,Y3)
= (0,0,0), (0,0,1), (0,1,0), (0,1,1), (1,0,0), (1,0,1), (1,1,0),
(1,1,1), respectively.
The response must be a three-column matrix of ones and zeros only. Note that each of the 8 combinations of the multivariate response need to appear in the data set, therefore data sets will need to be large in order for this family function to work.
Thomas W. Yee
Yee, T. W. and Wild, C. J. (2001) Discussion to: ``Smoothing spline ANOVA for multivariate Bernoulli observations, with application to ophthalmology data (with discussion)'' by Gao, F., Wahba, G., Klein, R., Klein, B. Journal of the American Statistical Association, 96, 127–160.
McCullagh, P. and Nelder, J. A. (1989) Generalized Linear Models, 2nd ed. London: Chapman & Hall.
Documentation accompanying the VGAM package at http://www.stat.auckland.ac.nz/~yee contains further information and examples.
data(hunua) fit = vglm(cbind(cyadea,beitaw,kniexc) ~ altitude, loglinb3, data=hunua) coef(fit, mat=TRUE) fitted(fit)[1:4,] summary(fit)