jasp-issues icon indicating copy to clipboard operation
jasp-issues copied to clipboard

[Feature Request]: Latent Class Growth Analysis and Growth Mixture Modelling

Open TarandeepKang opened this issue 2 years ago • 17 comments

Description

No response

Purpose

Understanding heterogeneity in individual outcomes over time

Use-case

See description in additional context

Is your feature request related to a problem?

No response

Is your feature request related to a JASP module?

No response

Describe the solution you would like

Implement growth mixture modelling as an option in JASP

Describe alternatives that you have considered

Use R/ Mplus, the second of which is proprietary and expensive

Additional context

Klaas Wardenaar,- in his excellent tutorial,- introduces these approaches saying that they are “used to explain between subject heterogeneity in growth on an outcome by identifying latent classes with different growth trajectories.”

PsyArXiv Preprints | Latent Class Growth Analysis and Growth Mixture Modeling using R: A tutorial for two R-packages and a comparison with Mplus.

This request is related to #1505, but is an extension of the latent class analysis suggested there.

My preference for an R package to use when conducting this analysis is lcmm:

Proust-Lima, C., Philipps, V., & Liquet, B. (2017). Estimation of Extended Mixed Models Using Latent Classes and Latent Processes: The R Package lcmm. Journal of Statistical Software, 78(2). https://doi.org/10.18637/jss.v078.i02

An example, albeit using Mplus, of this type of analysis from my field of research can be seen in:

Tao, T. J., Liang, L., Liu, H., Hobfoll, S. E., Hou, W. K., & Bonanno, G. A. (2023). The interrelations between psychological outcome trajectories and resource changes amid large-scale disasters: A growth mixture modeling analysis. Translational Psychiatry, 13(1), Article 1. https://doi.org/10.1038/s41398-023-02350-4

This paper provides an overview of the different use cases for the various trajectory modelling approaches, including latent transition analysis which I forgot to mention above. It also discusses various software implementations more comprehensively. But I would say that you should be able to cover the complete set of tools with two or three packages:

Nguena Nguefack, H. L., Pagé, M. G., Katz, J., Choinière, M., Vanasse, A., Dorais, M., Samb, O. M., & Lacasse, A. (2020). Trajectory Modelling Techniques Useful to Epidemiological Research: A Comparative Narrative Review of Approaches. Clinical Epidemiology, 12, 1205–1222. https://doi.org/10.2147/CLEP.S265287

TarandeepKang avatar Feb 27 '23 16:02 TarandeepKang

@TarandeepKang Would this fit better into the SEM or the timeseries module?

tomtomme avatar Feb 11 '24 09:02 tomtomme

I'd say either SEM as you've assigned or some yet-to-be-created "mixture", module, perhaps alongside #1505

TarandeepKang avatar Feb 13 '24 14:02 TarandeepKang

Hi @tomtomme, I wonder if you have any updates on this? Perhaps we could ask @EJWagenmakers? Some bits of this are possible in SPSS, but the rest in R and also I think in stata.

I certainly do think that this request, together with #397 and #1505, would make a good "mixture" module, and the incorporated features would be appreciated and widely used.

I can well understand that these might not be at the top of the list for ordinary experimental methods. But for psychologists like me, and those across the broader social sciences who work with questionnaire data (or possibly other longitudinal), these are certainly useful! I can also see applications in biology and medicine.

TarandeepKang avatar Dec 16 '24 17:12 TarandeepKang

@TarandeepKang I do not have informations on priorities like this since I live in Hamburg and since the roadmap for the next jasp release is largely kept internal. But you may be able to filter the public issues for project 0.20 like this: https://github.com/jasp-stats/jasp-issues/issues?q=is%3Aopen+is%3Aissue+project%3Ajasp-stats%2F38+label%3A%22Feature+Request%22

to see what might surface next. But this does not include internal issues and is mostly tagged with a big "maybe" to not raise expectations.

tomtomme avatar Dec 19 '24 08:12 tomtomme

It is definitely an important topic, but I can't say that we find someone to implement this soon. Us module maintainers are mostly a small team of volunteers that do all this next to their own research and teaching responsibilities. The mentioned topic is somewhat outside my expertise, so it wouldn't be quick for me to implement. Our goal is still to have more contributors by making the contribution process easier, but we are not there yet. Sorry I can't give you better news at the moment.

juliuspfadt avatar Jan 06 '25 16:01 juliuspfadt

Sorry, @juliuspfadt I only just saw that you had responded here. It's amazing how much you do get done! So I just wanted to say a huge thank you for all your work on factor and SEM! It will be worth the wait for somebody to get around to LCA/LPA and mixture models more generally. I wish I could help, but while I might be a relatively decent programmer with R, I've no experience at all of building graphical user interfaces etc.

TarandeepKang avatar Mar 10 '25 14:03 TarandeepKang

@TarandeepKang maybe you could have a chat with bmatyasb who is building a plotbuilder module and who also had only R knowledge at the beginning as far as I know, see https://github.com/jasp-stats/jasp-issues/issues/3083

tomtomme avatar Mar 10 '25 20:03 tomtomme

I like this solution :)

juliuspfadt avatar Mar 11 '25 09:03 juliuspfadt

in any case we are working on a more straightforward process to have people contribute; I agree that at the moment its quite steep learning curve.

juliuspfadt avatar Mar 11 '25 09:03 juliuspfadt

I think it is quite doable, when you just want to improve / edit an existing module. I am probably the worts programmer on earth and was able to add the "coefficient of variation" to descriptives 5 years ago. And I also knew only a little bit of R. But doing a completely new module is of course much harder indeed

tomtomme avatar Mar 11 '25 11:03 tomtomme

I agree, and am absolutely interested in chatting with some team members about this! :-) But, I suggest perhaps taking baby steps. For example, I'm going to need a practical run-through on creating copies of modules and making changes to them with GitHub for a start! Then, I wonder if it would be a better idea to have me begin by making more minor enhancements to existing modules. I could work on a new feature or two for the factor module, for @juliuspfadt? Or finish implementing some new types of means for descriptives that someone seems to have started ages ago? And if all that goes well then work on LPA or LCA?

TarandeepKang avatar Mar 16 '25 17:03 TarandeepKang

@TarandeepKang to help with the Git stuff of branching, pulling, forking etc. I used Github Desktop back in the day, see https://github.com/apps/desktop That helped me a lot to overcome the first hurdles. Then there is also our dev guide of course, see: https://github.com/jasp-stats/jasp-desktop/blob/development/Docs/development/readme.md

I would probably start reading here: https://jasp-stats.org/2021/03/25/how-to-add-functionality-to-jasp/ then https://github.com/jasp-stats/jasp-desktop/blob/development/Docs/development/jasp-module-workflow.md to get an idea.

And then I would fork the jasp-repo / module that I want to modify with github desktop and setup JASP to use this as a dev-module. To modify the actual files I used a simple text editor with syntax highlighting, but you can of course also go with qt creator, mentioned in the dev guide. May depend on the OS you are on. Which OS are you on?

@boutinb @JorisGoosen are the instructions in the video (https://www.youtube.com/watch?v=cw7v8YxCV8o) from the blog post above still current enough to get started?

Cheers, Thomas

tomtomme avatar Mar 19 '25 11:03 tomtomme

Im assuming the mentioned video is a bit out of date as we now have an easier way of installing modules. Keeping all of that in R. (installing via setting a libpath)

@PabRod is also going to make a PR to the https://github.com/jasp-stats/jaspModuleTemplate that you can base your work off, which doesnt now contain a good example. But should after the PR gets merged.

We can also add you to the "module development" channel in our mattermost so you can directly ask for help in a channel with others who worked on modules. In case you get stuck on something small this can be a nice low-effort way to get some input from us.

I would recommend against cloning jasp-desktop and trying to build JASP yourself though, unless you want to develop on the main application this is mostly a lot of hassle. Just using a released version or a nightly and then installing the module in R to load in JASP during development is probably the best way.

JorisGoosen avatar Mar 19 '25 13:03 JorisGoosen

Here is the link to the pull request mentioned above.

PabRod avatar Mar 19 '25 14:03 PabRod

Thanks for all your help in this. The basics are all working now (fingers crossed)! It would certainly be useful to join your communication channel, not least as a way to possibly be assigned some tasks of appropriate difficulty—or perhaps I should rather say ease! I will say again, I certainly don't think I should start with developing a module on my own! :-) Way out of my league. I've never put a GUI on anything before. Never mind pulling, pushing and fixing merge conflicts! Although at least the basic mechanics of git seem to make sense!

TarandeepKang avatar Mar 22 '25 11:03 TarandeepKang

@TarandeepKang can you send an email to julius.pfadt(at)gmail.com, with that email I can then add you to the channel.

juliuspfadt avatar Mar 23 '25 10:03 juliuspfadt

Hi @TarandeepKang,

I just got a question about these types of analysis during a workshop, so was pleased to find out you have been doing some work here. Is there anything I can do to help out? I could not find you in the Mattermost instance (communication channel for JASP contributors), so figured I reach out here.

Cheers, Johnny

JohnnyDoorn avatar Oct 20 '25 12:10 JohnnyDoorn