View source: R/lrt_order_cat.R
| run_order_tests_cat | R Documentation |
Performs sequential likelihood ratio tests for AD orders 0 vs 1, 1 vs 2, etc.
run_order_tests_cat(
y,
max_order = 2,
blocks = NULL,
homogeneous = TRUE,
n_categories = NULL,
test = c("lrt", "score", "mlrt", "wald")
)
y |
Integer matrix of categorical data (n_subjects x n_time). |
max_order |
Maximum order to test. Default is 2. |
blocks |
Optional block membership vector. |
homogeneous |
Whether to use homogeneous parameters across blocks. |
n_categories |
Number of categories (inferred if NULL). |
test |
Type of test statistic for each pairwise comparison. One of
|
This function performs forward selection: starting from order 0, it tests whether increasing the order provides significant improvement. The selected order is the highest order where the test was significant (at alpha = 0.05).
A list containing:
tests |
List of test_order_cat results for each comparison |
table |
Summary data frame with all comparisons |
fits |
List of all fitted models |
selected_order |
Recommended order based on sequential testing at alpha=0.05 |
y <- simulate_cat(200, 6, order = 1, n_categories = 2)
result <- run_order_tests_cat(y, max_order = 2)
print(result$table)
cat("Selected order:", result$selected_order, "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.