-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
umxSuperModel: handle nesting better #221
Comments
In tmpnames = umxModelNames(newModel)
dupes = tmpnames[duplicated(tmpnames)] # "top" "MZ" "DZ"
if(length(dupes) > 0){
suffix = 2
subNames = names(newModel$submodels)[-1]
for(thisSub in subNames){
thisModel = newModel$submodels[[thisSub]]
for(thisDupName in dupes){
thisModel = mxRename(thisModel, paste0(thisDupName, "_", suffix), oldname = thisDupName)
}
newModel = mxModel(newModel, thisModel)
suffix = suffix + 1
} |
The issue is in the excerpt above, when the innermost for loop is run, if there is more than 2 models, suffix will not have increased and mxRename will complain. There is an ugly solution: move up suffix = suffix + 1 to the innermost loop, three lines up. Which will result in: > umxModelNames(multi)
[1] "a" "b" "c" "top" "topMZ" "topDZ" "top_2" "topMZ_3"
[9] "topDZ_4" "top_8" "topMZ_9" "topDZ_10" Still thinking in something more elegant. |
I'll have a look |
Thanks.
I see that sometimes the starting values for the thresholds are not always ascending, not sure that this is what is causing this issue.
Luis Araujo
T32 | Virginia Institute for Psychiatric and Behavioral Genetics | Richmond | US
Department of Psychiatry | The University of Melbourne | AU
+1 804 502-4074 (tel:+1%20804%20502-4074)
http://go.unimelb.edu.au/y5yr
…On Oct 4 2023, at 5:09 am, Tim Bates ***@***.***> wrote:
I'll have a look
—
Reply to this email directly, view it on GitHub (#221 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ACNLSLTGMCWAHBNSDZA6CWTX5URUVAVCNFSM6AAAAAA4PBYEQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBWGQ2TONJXHE).
You are receiving this because you authored the thread.
|
Super models with nested submodels are handled up to two, but no more:
The issue lies at the underlying renaming functionality, that is only checking up to two submodels.
The text was updated successfully, but these errors were encountered: