seq_loglm(x,
type = c("joint", "conditional", "mutual", "markov", "saturated"),
marginals = 1:nf, vorder = 1:nf,
k = NULL, prefix = "model", fitted = TRUE, ...)"Freq"."joint", "conditional", "mutual", "markov",
or "saturated".1:nf
where nf is the number of factors in the full n-way table.1:nf,
used to reorder the variables in the original table for the purpose
of fitting sequential marginal models.type = "joint", "conditional"
or Markov chain order for type = "markov"loglm to store the fitted values in the
model objects"loglmlist", each of which is a class "loglm" objectchisq.test) and add
successive variables one at a time in the order specified by
vorder.
All model types give the same result for the two-way margin,
namely the test of independence for the first two factors.
Sequential models of joint independence (type="joint")
have a particularly simple interpretation, because they
decompose the likelihood ratio test for the model of
mutual independence in the full n-way table, and hence
account for "total" association in terms of portions attributable
to the conditional probabilities of each new variable,
given all prior variables.loglin-utilities for descriptions of sequential models,
conditional,
joint,
mutual, ...loglmlist,data(Titanic, package="datasets")
# variables are in the order Class, Sex, Age, Survived
tt <- seq_loglm(Titanic)Run the code above in your browser using DataLab