Skip to content
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

suggested fix for score-based tests on OpenMx models without labels #69

Closed
wants to merge 2 commits into from

Conversation

brandmaier
Copy link
Owner

The following code does not work with current semtree and score-based tests because the model has no labelled parameters. Thus, the score computation returns only zeros and the tree will find no split. I suggest that we identify free parameters not by whether their labels match in the OpenMx matrices but whether the free matrix has respective entries of true or false.

library(OpenMx)
library(semtree)

set.seed(2349)

manifests<-c("DeltaPA")
latents<-c()
model <- mxModel("Simple Model", 
                 type="RAM",
                 manifestVars = manifests,
                 latentVars = latents,
                 mxPath(from="one",to=manifests,
                        free=c(TRUE), 
                        value=c(1.0) , arrows=1#, 
                       # label=c("mu") 
                        ),
                 mxPath(from=manifests,to=manifests,
                        free=c(TRUE), value=c(1.0) , 
                        arrows=2#, 
                       # label=c("sigma2") 
                        ),
                 mxData(tree.data, type = "raw")
);
fitted <- mxRun(model)
ctrl = semtree.control(
  method="score", 
  bonferroni = TRUE)
tree = semtree( model = model, 
                data = tree.data, 
                control=ctrl)

@brandmaier brandmaier closed this Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant