Hello,
I am wondering how to get covariance matrix of parameter estimates (e.g., inverse of Fisher's information matrix) in an SEM with OpenMx. I have included a sample code for a path model below. For example, I would like to get covariances between estimates of b1, b2, and cp that include in the covariance matrix.
library(OpenMx) set.seed(1234) n <- 100 x <- rnorm(n) m <- 0.1 * x + rnorm(n) y <- 0.3 * m + rnorm(n) df <- data.frame(x = x, y = y, m = m) manifests = c("x", "m", "y") myModel <- mxModel( "Path Model", type = "RAM", manifestVars = manifests, mxPath( from = 'one', to = manifests, free = FALSE, values = 0 ), mxPath( from = "x", to = "m", arrows = 1, free = TRUE, values = 0, labels = "b1" ), mxPath( from = c("x", "m"), to = "y", arrows = 1, free = TRUE, values = 0, labels = c("cp", "b2") ), mxPath( from = manifests, arrows = 2, free = TRUE, values = 1, labels = c("s2x", "s2m", "s2y") ), mxData(df, type = "raw") ) fit <- mxRun(myModel) summary(fit)
Here's how to implement vcov. This will be included in the next release,
So if you need it now you can do
2 * solve(fit$output$hessian)
or if you want to wait for the next release it will bevcov(fit)
.Thanks for your fast response. Truly appreciated. Any time table for the next release?
Internally we've discussed mid-October, so maybe 2-3 weeks.