loglin-dim | R Documentation |
Return the dimension of a log-linear model given by the generating class 'glist'. If the model is decomposable and adjusted dimension can be found.
dim_loglin(glist, tableinfo)
dim_loglin_decomp(glist, tableinfo, adjust = TRUE)
glist |
Generating class (a list) for a log-linear model. See 'details' below. |
tableinfo |
Specification of the levels of the variables. See 'details' below. |
adjust |
Should model dimension be adjusted for sparsity of data (only available for decomposable models) |
glist
can be either a list of vectors with variable names or a list
of vectors of variable indices.
tableinfo
can be one of three different things.
A contingency table (a table
).
A list with the names of the variables and their levels (such as one
would get if calling dimnames
on a table
).
A vector with the levels. If glist
is a list of vectors with
variable names, then the entries of the vector tableinfo
must be
named.
If the model is decomposable it dim_loglin_decomp
is to be preferred over
dim_loglin
as the former is much faster.
Setting adjust=TRUE
will force dim_loglin_decomp
to calculated a
dimension which is adjusted for sparsity of data. For this to work,
tableinfo
MUST be a table.
A numeric.
Søren Højsgaard, sorenh@math.aau.dk
dmod
, glm
, loglm
## glist contains variable names and tableinfo is a named vector:
dim_loglin(list(c("a", "b"), c("b", "c")), c(a=4, b=7, c=6))
## glist contains variable names and tableinfo is not named:
dim_loglin(list(c(1, 2), c(2, 3)), c(4, 7, 6))
## For decomposable models:
dim_loglin_decomp(list(c("a", "b"), c("b", "c")), c(a=4, b=7, c=6),adjust=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.