Description Usage Arguments Value Examples
Find the most fit model by grid search of number of models
1 | find_best_fit(data, form, criterion = "bic", maximum_num_class = 7, ...)
|
data |
The dataframe to pass in |
form |
the formula for the LDA modeling |
criterion |
The criterion to choose the best model, default to BIC. Possible options include "aic","Gsq" and "llike" |
maximum_num_class |
If you input the data to let the function find out the most fit by the criterion of BIC, what is the maximum number of classes you want it in the search space; Optional, default to 7. If you input a model object in the model parameter, this parameter will be nullified. |
... |
The wrapper arguments for the poLCA fitting function in the poLCA package. All the arguments passed within here will be passed into the poLCA function. |
The model object of the most fit model according to the criterion
1 2 3 4 5 | # Define a formula for the LDA modeling
f = with(data, cbind(tax, religion, free_election, state_aid, civil_rights, women)~1)
# This will yield the best model according to the criterion. The model object could be
# passed into further ploting functions
best_model = find_best_fit(data, form = f, criterion = 'bic')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.