Tables of a grouped Markov order test
Source:R/memory_markov_order.R
hg_get.net_markov_order_group.RdThe per-group test tables stacked into one data.frame, with a group
column naming the group each row came from. This is the supported way to
read a net_markov_order_group; the print method shows each group in turn
but a comparison across groups needs one table.
Arguments
- x
A
net_markov_order_group, as returned bymarkov_order()on anetobject_group.- what
"orders"(default) for one row per group and order, or"null"for the permutation null draws, one row per group, order and replicate.- ...
Unused.
- top
Keep only the first
toprows, applied last.
Value
A base data.frame. For what = "orders", one row per group and
order, with group first and then the columns of
hg_get.net_markov_order(). For what = "null", one row per
group, order and replicate with columns group, order, replicate,
g2. Returns a zero-row frame with those columns when the group is
empty.
Examples
seqs <- list(c("a", "b", "a", "c"), c("b", "a", "c", "a"))
fit <- markov_order(seqs, max_order = 2L, n_perm = 20L, seed = 1L)
hg_get(fit)
#> order log_likelihood aic bic df g2 p_value p_asymptotic
#> 1 0 -8.317766 20.63553 20.79442 NA NA NA NA
#> 2 1 -3.988984 13.97797 14.21629 4 8.317766 0.3333333 0.08060755
#> 3 2 -3.178054 12.35611 12.59443 0 0.000000 NA NA
#> significant
#> 1 NA
#> 2 FALSE
#> 3 FALSE