michaelhallquist / MplusAutomation

The MplusAutomation package leverages the flexibility of the R language to automate latent variable model estimation and interpretation using Mplus, a powerful latent variable modeling program developed by Muthen and Muthen (www.statmodel.com). Specifically, MplusAutomation provides routines for creating related groups of models, running batches of models, and extracting and tabulating model parameters and fit statistics.
81 stars 46 forks source link

Extract alternative parameterizations of categorical latent variables #187

Closed sam-crawley closed 1 year ago

sam-crawley commented 1 year ago

In some analyses (e.g. manual 3-step LCA regression), parameters are repeated, but with a different reference class. Extract these if they are present.

michaelhallquist commented 1 year ago

Looks great, @sam-crawley! Thanks for the contribution.

Michael

linem7 commented 1 month ago

Hi @sam-crawley ,

Is it possible to include results from the auto 3-step method (i.e., BCH method)? The results are similar to the situation you described, with several logistic regression models created for different reference class.

Thanks for your valuable contributions!

Best, Linem

sam-crawley commented 1 month ago

I'm sure it's possible. If you open an issue and provide sample output, I might be able to look at it.

linem7 commented 1 month ago

Thank you for your help. I have replied to a relative issue and uploaded the corresponding example here: https://github.com/michaelhallquist/MplusAutomation/issues/192#issuecomment-2118798161. I would like to assist further, but I barely understand the original code, so I have to seek your help. Please let me know if there is anything I can do.

Thanks again for your assistance.

Best regards, Linem

michaelhallquist commented 1 month ago

Hi Linem,

Last week, I wrote a parser that pulls out these sections for the R3STEP method. You can get access to this by installing the development version of the package via Github: devtools::install_github("michaelhallquist/MplusAutomation").

Here's a quick example.

Hope this helps, Michael

> m <- readModels("/Users/hallquist/Data_Analysis/r_packages/MplusAutomation/tests/testthat/mplus_ug/8.11/ex8.6r3step.out")
> m$r3step
$multinomialTests
  paramHeader param    est    se est_se  pval ReferenceClass
1      C#1.ON     X -1.975 0.212 -9.320 0.000              2
2  Intercepts   C#1 -0.120 0.153 -0.781 0.435              2
3      C#2.ON     X  1.975 0.212  9.320 0.000              1
4  Intercepts   C#2  0.120 0.153  0.781 0.435              1

$multinomialOdds
  paramHeader param   est    se lower_2.5ci upper_2.5ci ReferenceClass
1      C#1.ON     X 0.139 0.029       0.092       0.210              2
2      C#2.ON     X 7.206 1.527       4.757      10.916              1

$ci.unstandardized
  paramHeader param  low.5 low2.5   low5    est    up5  up2.5   up.5 ReferenceClass
1      C#1.ON     X -2.521 -2.390 -2.323 -1.975 -1.626 -1.560 -1.429              2
2  Intercepts   C#1 -0.515 -0.421 -0.372 -0.120  0.133  0.181  0.276              2
3      C#2.ON     X  1.429  1.560  1.626  1.975  2.323  2.390  2.521              1
4  Intercepts   C#2 -0.276 -0.181 -0.133  0.120  0.372  0.421  0.515              1

$ci.odds
  paramHeader param low.5 low2.5  low5   est    up5  up2.5   up.5 ReferenceClass
1      C#1.ON     X 0.080  0.092 0.098 0.139  0.197  0.210  0.240              2
2      C#2.ON     X 4.175  4.757 5.085 7.206 10.211 10.916 12.437              1
linem7 commented 1 month ago

Dear Michael,

Thanks so much for your help! It helps a lot, and I will try it later. Thank you again for your assistance!

Best regards, Linem