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
)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
Fitted poLCA object, the null model
Fitted poLCA object, the alt model
Number of bootstrap samples
Number of threads
Number of initial values to try when fitting on the bootstrap samples
Maximum number of iterations for EM algorithm
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