cjvanlissa / tidySEM

56 stars 7 forks source link

add extratries to mx_lca and AvePP to classprob #63

Closed maugavilla closed 1 year ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #63 (8a80fba) into master (ef4840e) will not change coverage. The diff coverage is n/a.

@@          Coverage Diff           @@
##           master     #63   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           1       1           
  Lines           2       2           
======================================
  Misses          2       2           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

cjvanlissa commented 1 year ago

Hello @maugavilla! I apologize, my email notifications are no longer working, so I totally missed this... I will accept the average posterior probabilities function, but reimplement it in base R. The extratries argument is not a good idea; every model is still of class MxModel, so people can always add extra tries by running mxTryHard. More importantly, I'd like to enhance the function run_mx() to do this automatically when detecting the appropriate error codes. I've just implemented this for categorical variables; for continuous ones, it still needs to be done.

cjvanlissa commented 1 year ago

Actually, I am not incorporating AvePP either, because it is identical to avg.mostlikely:

class <- apply(post_prob, 1, which.max)
  t(sapply(1:ncol(post_prob), function(i) {
    colMeans(post_prob[class == i, , drop = FALSE])
maugavilla commented 1 year ago

The diagonal is the same, but I liked to show the min and max within the most likely class

Ok, so you want to run_mx to decide when to use the estratries, or the user to run it with the OpenMx functions. Would be good to have examples on how then steps to use the OpenMx functions

cjvanlissa commented 1 year ago

To be honest, I feel that class_prob() is already a bit bloated; it's because I tried to fit in all the stuff Mplus provides. What is direly needed imo is a clear discussion of which parts of this output are useful for various diagnostics.

Wrt OpenMx functions: I think it's a relatively advanced use case, but we can put at least one example in the paper!