| blrt | R Documentation |
Does the bootstrap likelihood ratio test. Provide two fitted models, the null model and the alt model fitted with a different number of clusters/latent classes. Bootstrap samples are generated using the null model. The null model and the alt model are refitted on the bootstrap samples to investigate the log likelihood ratio of the two models.
blrt(
model_null,
model_alt,
n_bootstrap,
n_thread = parallel::detectCores(),
n_rep = 1,
max_iter = 1000,
tol = 1e-10
)
model_null |
Fitted |
model_alt |
Fitted |
n_bootstrap |
Number of bootstrap samples |
n_thread |
Number of threads |
n_rep |
Number of initial values to try when fitting on the bootstrap samples |
max_iter |
Maximum number of iterations for EM algorithm |
tol |
Tolerance for difference in log likelihood, used for stopping condition |
Runs in parallel for each bootstrap sample, potentially high memory if the data is large
List containing the following:
fitted_log_ratio: log likelihood ratio comparing the null and alt models
bootstrap_log_ratio: vector of length n_bootstrap, bootstrapped log
likelihood ratio comparing the null and alt models
p_value: the proportion of bootstrap samples with log likelihood ratios
greater than the fitted log likelihood ratio
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.