
propodds(reverse = TRUE, whitespace = FALSE)
cumulative
."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.ordered
.cumulative(reverse = reverse, link = "logit", parallel = TRUE)
.
Please see cumulative
for more details on this model.
Yee, T. W. (2010)
The
Yee, T. W. and Wild, C. J. (1996) Vector generalized additive models. Journal of the Royal Statistical Society, Series B, Methodological, 58, 481--493.
Documentation accompanying the
cumulative
.# Fit the proportional odds model, p.179, in McCullagh and Nelder (1989)
pneumo <- transform(pneumo, let = log(exposure.time))
(fit <- vglm(cbind(normal, mild, severe) ~ let, propodds, pneumo))
depvar(fit) # Sample proportions
weights(fit, type = "prior") # Number of observations
coef(fit, matrix = TRUE)
constraints(fit) # Constraint matrices
summary(fit)
# Check that the model is linear in let ----------------------
fit2 <- vgam(cbind(normal, mild, severe) ~ s(let, df = 2), propodds, pneumo)
plot(fit2, se = TRUE, lcol = 2, scol = 2)
# Check the proportional odds assumption with a LRT ----------
(fit3 <- vglm(cbind(normal, mild, severe) ~ let,
cumulative(parallel = FALSE, reverse = TRUE), pneumo))
pchisq(deviance(fit) - deviance(fit3),
df = df.residual(fit) - df.residual(fit3), lower.tail = FALSE)
lrtest(fit3, fit) # Easier
Run the code above in your browser using DataLab