Latent Profile Analysis (LPA) with R

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ • 26

  • @cecilialeung1231
    @cecilialeung1231 2 дні тому +1

    Hi, wonder if there is a syntax that I could get the number of sample in each class ?

    • @RegorzStatistik
      @RegorzStatistik  2 дні тому +1

      If you have a dataframe with a variable for the assignes class you could simply run the table() function on this variable.

  • @ahmadvalikhani6290
    @ahmadvalikhani6290 3 місяці тому

    Great! 1) What should we do when we combine longitudinal variables (measured at different time points) and variables measured only once? 2) When we have several measures of almost the same variables, can we use all of them or will it create a problem and need to choose one?

    • @RegorzStatistik
      @RegorzStatistik  3 місяці тому +1

      I haven't come across this situation, yet, so I don't know. Here are my guesses:
      ad 1: For something like that I would prefer using LCGA (latent class growth analysis or GMM (growth mixture modeling) instead of LPA.
      ad 2: In this case I think I would combine those measures into one value and include that in the LPA.

    • @ahmadvalikhani6290
      @ahmadvalikhani6290 3 місяці тому

      @@RegorzStatistik Actually, I plan to identify latent groups based on three variables measured longitudinally. However, these three measures were not assessed at the same time points. For example, x was measured at ages 11 and 14, y was measured at 103 months, 9 years, and 11 years, and z was measured at ages 8, 10, 12.5, 13.5, and 17.5. As you can see, the intervals within each variable and between variables are not equal. Do you think I can still use GMM in this situation?

    • @RegorzStatistik
      @RegorzStatistik  3 місяці тому

      ​@@ahmadvalikhani6290 In that case I don't think GMM will work (but I have no experience with a data situation like this).
      One problem for a LPA could be that z (with 5 timepoints) will dominate the analysis. If you run a LPA I think I would run at least two models: one with the full set of variables and one with only 2 or 3 ages for y to counter that threat (but that is only my intuition, not based on any literature).

    • @ahmadvalikhani6290
      @ahmadvalikhani6290 3 місяці тому

      @@RegorzStatistik Thanks. I will try to use cross-sectional data. Apart from that, I have kept encountering this error, but I could not find the reason or solution for it:
      The 'variances'/'covariances' arguments were ignored in favor of the 'models' argument.
      Warning in (function (data, modelName = NULL, nboot = 999, level = 0.05, :
      some model(s) could not be fitted!
      Warning in (function (data, modelName = NULL, nboot = 999, level = 0.05, :
      only 1-component model could be fitted. No LRT is performed!
      Warning: Mclust could not estimate model 2 with 5 classes.
      Warning: Mclust could not estimate model 6 with 2 classes.
      Warning: Mclust could not estimate model 6 with 3 classes.
      Warning: Mclust could not estimate model 6 with 4 classes.
      Warning: Mclust could not estimate model 6 with 5 classes.
      Warning:
      One or more analyses resulted in warnings! Examine these analyses carefully: model_2_class_5, model_3_class_5, model_6_class_2, model_6_class_3, model_6_class_4, model_6_class_5

    • @RegorzStatistik
      @RegorzStatistik  3 місяці тому

      @@ahmadvalikhani6290 I guess some models could not be estimated, e.g. convergence issues. Nothing more I can say based on this.

  • @JuliaKarska
    @JuliaKarska Місяць тому +1

    I wonder what to do when my variables are distributed far from normality, even after box-cox or log10... Should I resign then from LPA? Thanks.

    • @RegorzStatistik
      @RegorzStatistik  Місяць тому

      I have read that there is something like nonparametric LPA that does not assume normality. But I don't know if there is an R implementation for that.

  • @PrabhathW
    @PrabhathW Рік тому +1

    Great...Very helpful... Thank you.

  • @hannahalveshagy4141
    @hannahalveshagy4141 Рік тому

    Super helpful! If I wanted to control / account for a variable (e.g., education) in theLPA how mightI be able to alter the code to do that?

    • @RegorzStatistik
      @RegorzStatistik  Рік тому

      I am not sure if this package can do that, I haven't found anything about that in its documentation (and, at least, I don't know how to do it).
      I'd guess that MPlus would provide these capabilities.

  • @laurapissani
    @laurapissani 9 місяців тому

    This was really useful, thank you. I wonder if there is a part two, the one thing I could not figure out is how to see which subjects belong to which class. I can see their assigned id but not to which of my subject number would that correspond.

    • @RegorzStatistik
      @RegorzStatistik  9 місяців тому

      I believe the id is assigned in the order of the cases in the dataframe. I think with your original dataframe you could map your subject number to the case id (= to its position in the dataframe) and then merge those two dataframes (one with two columns, id and subject number, and the second with the results of the LPA) using the id - but programming these kinds of data transformations in r is not my core competency.

  • @JuliaKarska
    @JuliaKarska 3 місяці тому

    Great video! I have a beginner question: how can I upload my own database instead of this pisaUSA15? With which code? My database is in csv format.

    • @RegorzStatistik
      @RegorzStatistik  3 місяці тому

      I think there are many videos about how to import a csv file. I guess you will find them my searching in UA-cam with this search string:
      r import csv

  • @jiahaowang1558
    @jiahaowang1558 Рік тому

    Very clear and heloful. Thank you! Would you give us some more details about data process and estimation problems when using model 2, 3 or 6 compared to 1?

    • @RegorzStatistik
      @RegorzStatistik  Рік тому

      I don't have more details about that. In general, the more latent parameters you are estimating the larger the risk of estimation problems.

  • @anton6562
    @anton6562 9 місяців тому

    Do you think Multilevel LPA is possible in R?

  • @Quynhhoaquynh
    @Quynhhoaquynh Рік тому

    my plot is blank, i don't know why

    • @RegorzStatistik
      @RegorzStatistik  Рік тому

      Unfortunately, I don't know why that happened with your data.

    • @Quynhhoaquynh
      @Quynhhoaquynh Рік тому

      @@RegorzStatistik could you do a multi-group latent profile analyses (LPAs) with r video?

    • @RegorzStatistik
      @RegorzStatistik  Рік тому

      @@Quynhhoaquynh I don't have any experience with multi-group LPA.