gom_ml | R Documentation |
This function takes a data object and creates a fixed, small set of extreme profiles, each characterized by the probabilities of answering a category of each question, along with a set of scores (or grades of membership) that measures each subject’s degree of similarity to each extreme profile (reference group).
gom_ml(
data.object = NULL,
initial.K = 2,
final.K = initial.K,
gamma.algorithm = c("gradient.1992", "woodbury.1974"),
initial.gamma = c("equal.values", "random", "pure1", "gamma.object"),
initial.gamma.object = NULL,
gamma.fit = TRUE,
lambda.algorithm = c("gradient.1992", "woodbury.1974"),
initial.lambda = c("random", "pure1", "equal.values", "lambda.object"),
initial.lambda.object = NULL,
lambda.fit = TRUE,
case.id = NA,
case.weight = NA,
internal.var = NULL,
order.K = TRUE,
omega.fit = FALSE,
dec.char = ".",
MC_iter = 1000
)
data.object |
A data frame or an object that can be coerced to a data frame. |
initial.K |
An integer indicating the initial number of the set of pure type probabilities to be estimated. |
final.K |
An integer indicating the largest number of the set of pure type probabilities to be estimated. |
gamma.algorithm |
A character that specifies the algorithm to be used to estimate the gamma values. |
initial.gamma |
A character that specifies how the initial gamma values should be specified. If "gamma.object", then initial.gamma.object is needed. |
initial.gamma.object |
A data frame with the initial gamma values for each observation. |
gamma.fit |
A logical value indicating if the gamma values need to be estimated. |
lambda.algorithm |
A character that specifies the algorithm to be used to estimate the lambda values. |
initial.lambda |
A character that specifies how the initial lambda values should be specified. If "lambda.object", then initial.lambda.object is needed. |
initial.lambda.object |
An array with the initial lambda values for each category of each variable. |
lambda.fit |
A logical value indicating if the lambda values need to be estimated. |
case.id |
A character with the name of the variable with each observation ID. |
case.weight |
A character with the name of the variable which contains the weight for each observation. |
internal.var |
A character vector with the name of the variables to be used by the model. |
order.K |
A logical value indicating if the lambdas should be organized with 99 percent confidence interval. |
omega.fit |
A logical value specifying if the model should generate missing patterns of the data before compiling. |
dec.char |
A character with the decimal symbol to be used in the output files. |
MC_iter |
The number of iterations to be used within the Monte Carlo Simulation. |
gom_ml saves two files, one containing a table with unique data configuration along with the grades of membership, and another file with the initial and final pure type probabilities along with some summary statistics. The gom_ml function also returns an object of class gom_ml with the following components:
A data frame with the original data given by the user and the gamma for each observation.
An array with the pure type probabilities. The array dimensions equal the number of extreme profiles, variables and categories, respectively.
The maximum log-likelihood achieved by the model.
The Akaike Information Criterion.
A table with the posterior lambdas organized by variables and their categories.
data <- data.frame(x1 = round(stats::runif(n = 100, 1, 2), 0),
x2 = round(stats::runif(n = 100, 1, 3), 0),
Id = 1:100)
gom_ml(data.object = data, case.id = "Id", initial.lambda = "random", MC_iter = 300)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.