1
$\begingroup$

Latent Class Growth Analysis and Growth Mixture Models (synonyous; henceforth referred to as GMM) explain between-subject heterogeneity in growth on an outcome by identifying latent classes with different growth trajectories. The below tutorial refers to how to implement them in R using the packages "lcmm" and "flexmix".

https://osf.io/preprints/psyarxiv/m58wx/

I would like to implement a GMM for binary outcomes (1/0). However, it states, "In many cases, additional steps or model elements are required, such as the fitting of non-linear growth functions or the use of alternative distributions and/or link functions (e.g., when working with count or binary outcomes). These topics are outside the scope of the current tutorial. Some subjects of interest are briefly discussed below."

I cannot find any documentation in lcmm or flexmix that a Growth Mixture Model can be fit to binary outcomes using a binomial model. Are there only linear models available in R for this type of model? Or is there a way to implement generalized linear models for GMMs in R? If so, would someone be able to direct me or provide instruction?

Barring the ability to model binary outcomes using a binomial model, would it be acceptable (albeit, not ideal) to fit a binary outcome in a GMM using a linear probability model (i.e., model binary outcome with a general linear model)?

$\endgroup$

1 Answer 1

1
$\begingroup$

I cannot find any documentation in lcmm or flexmix that a Growth Mixture Model can be fit to binary outcomes using a binomial model. Are there only linear models available in R for this type of model? Or is there a way to implement generalized linear models for GMMs in R? If so, would someone be able to direct me or provide instruction?

Yes, fitting growth mixture models (GMM) to binary data is possible using R. One package I am aware of is the poLCA package (Linzer & Lewis, 2011). See the code chunk below for an example using simulated data.

# Load the poLCA package
library(poLCA)

# Set a random seed for reproducibility
set.seed(123)

# Simulate data with two latent classes
n <- 500  # Total sample size
k <- 2    # Number of latent classes

# Simulate class membership probabilities
class_probs <- c(0.6, 0.4)  # Probability of belonging to each class

# Simulate class-specific response probabilities for two binary items
item_probs_class1 <- c(0.2, 0.8)  # Class 1 item probabilities
item_probs_class2 <- c(0.8, 0.2)  # Class 2 item probabilities

# Generate class membership for each observation
class_membership <- sample(1:k, size = n, replace = TRUE, prob = class_probs)

# Generate binary outcomes based on class membership
binary_data <- matrix(NA, nrow = n, ncol = 2)
for (i in 1:n) {
  if (class_membership[i] == 1) {
    binary_data[i, ] <- rbinom(1, size = 1, prob = item_probs_class1)
  } else {
    binary_data[i, ] <- rbinom(1, size = 1, prob = item_probs_class2)
  }
}

# Recode binary outcomes to start from 1
binary_data <- binary_data + 1

# Convert the data matrix to a data frame
binary_data <- as.data.frame(binary_data)
colnames(binary_data) <- c("Item1", "Item2")

# Fit a GMM to the simulated data
formula <- cbind(Item1, Item2) ~ 1
gmm_model <- poLCA(formula, data = binary_data, nclass = k)

# View the results
summary(gmm_model)

Barring the ability to model binary outcomes using a binomial model, would it be acceptable (albeit, not ideal) to fit a binary outcome in a GMM using a linear probability model (i.e., model binary outcome with a general linear model)?

Fitting binary outcomes in a GMM using a linear probability model (i.e., modeling binary outcomes with a general linear model) is not ideal because it may violate the assumption of normally distributed errors. Additionally, predicted probabilities from a linear probability model can fall outside the [0, 1] range, which is not appropriate for binary outcomes. Therefore, it's generally recommended to use a logistic link function within the framework of a generalized linear model for binary outcomes in GMMs. This being said, using a linear model for ordinal data would not be as big of an issue, especially as the number of ordinal responses increases. In fact, it may be preferred when the sample size is small to moderate as models for ordinal data require estimating more parameters.

References

Linzer, D. A., & Lewis, J. B. (2011). poLCA: An R package for polytomous variable latent class analysis. Journal of statistical software, 42, 1-29.

$\endgroup$
3
  • $\begingroup$ Thanks for the response-- Would the idea here be that the the cbind(Item1, Item2, ...) would be the longitudinal observations/indicators for the growth mixture model? In other words, item1 could be Jan, item2 could be Feb, item3 could March. But if you did it this way, it would not be able to take into account the longitudinal nature of GMMs, right? Or would this be a reasonable way to approach a GMM? $\endgroup$
    – JElder
    Dec 6, 2023 at 22:24
  • $\begingroup$ @JElder no problem! What you are describing is wide format, and I believe that is how you would estimate a GMM using poLCA. $\endgroup$ Dec 6, 2023 at 22:53
  • $\begingroup$ I am familiar with wide format, but I guess I didn't connect the dots that you don't need a special package to estimate a growth mixture model and you can just estimate a growth mixture model using Latent Class Analysis or Latent Profile Analysis, with the timepoints as manifest indicators in wide format. Makes a lot of sense now. Thank you $\endgroup$
    – JElder
    Dec 7, 2023 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.