OpenMx General Help
http://openmx.psyc.virginia.edu/taxonomy/term/7/0
enStaying informed with OpenMx
http://openmx.psyc.virginia.edu/thread/470
<p>The easiest way to keep up with the latest changes to the OpenMx software is to subscribe to receive email notification of any news updates. Assuming that you are logged in, click on the "My account" link on the left-hand panel of your screen. Next click on "Subscriptions" and then "Content types". Enable the checkbox for "News" and click on "Save". Once you have followed these steps, you will start receiving an email whenever something is posted under the "Recent News" section of the website (the top left panel, underneath the Guinea Pig). If you are concerned about inbox cluttering, it's ok you can expect a fairly low frequency of announcements.</p>
http://openmx.psyc.virginia.edu/thread/470#commentsOpenMx General HelpTue, 30 Mar 2010 14:24:47 +0000mspiegel470 at http://openmx.psyc.virginia.eduWelcome to the OpenMx General Help Forum
http://openmx.psyc.virginia.edu/thread/17-welcome-openmx-general-help-forum
<p>This forum is designed for general questions about how to use OpenMx. If you can't find another place where your question fits, then this is the place to be!</p>
http://openmx.psyc.virginia.edu/thread/17-welcome-openmx-general-help-forum#commentsOpenMx General HelpFri, 31 Jul 2009 18:51:09 +0000Steve17 at http://openmx.psyc.virginia.eduSEM, Binary and Categorical Data in independent variables
http://openmx.psyc.virginia.edu/thread/3956
<p>Dear all, Please help me fixing this problem. </p>
<p>The data set has (please see example diagram)<br />
+ 3 continuous variables(X1, X2, X3) for a latent variable (intercept)<br />
+ 3 mediators (one binary X8 and two categorical variables X6, X7)<br />
+ 1 dependent variable (X4).</p>
<p>This coding was based on the post about Categorical Data in both independent and dependent variables <a href="http://openmx.psyc.virginia.edu/thread/3883" title="http://openmx.psyc.virginia.edu/thread/3883">http://openmx.psyc.virginia.edu/thread/3883</a></p>
<p>When I run SEM.R model I have following error message.</p>
<p>Error in mxRAMObjective(A = "A", S = "S", M = "M", thresholds = "Threshold") :<br />
argument 'F' is not a string (the name of the 'F' matrix)</p>
<p>When I delete #Threshold matrix from the SEM.R, I have the following error message. </p>
<p>Error: The following error occurred while evaluating the subexpression '`Linear Growth Curve Model Path Specification.I` - `Linear Growth Curve Model Path Specification.A`' during the evaluation of 'expVars' in model 'Linear Growth Curve Model Path Specification' : non-conformable arrays</p>
<p>#Threshold matrix<br />
mxMatrix(type = "Full", nrow = 1, ncol = 7, free = c(T, T, T, T, T, T, T),<br />
values = c(-0.18173563, -1.27430357,-1.75717640, 0.37933827,-0.01542988, -0.82819033, -0.12312234), byrow = T, dimnames = list(c(), c("X1","X2","X3","X4","X6","X7","X8")),<br />
name = "Threshold"),<br />
#Means and covaraince matrix<br />
mxRAMObjective(A="A", S="S", M="M", thresholds = "Threshold")</p>
<p>I know you are busy! But I will return you back! I appreciate your time!</p>
<p>Hyoshin,<br />
University of Maryland</p>
<table id="attachments" class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/example1.txt">example1.txt</a></td><td>17.99 KB</td> </tr>
<tr class="even"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/SEM.R">SEM.R</a></td><td>2.95 KB</td> </tr>
<tr class="odd"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/example_0.pdf">example.pdf</a></td><td>98.36 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/3956#commentsOpenMx General HelpMon, 23 Feb 2015 19:38:55 +0000HYOSHIN3956 at http://openmx.psyc.virginia.eduAccess Kalman filter generated process state estimates online (mxExpectationStateSpace)
http://openmx.psyc.virginia.edu/thread/3952
<p>I am using the Kalman filter implementation (mxExpectationStateSpace) to fit a time-discrete vector auto-regressive model to single subjects' multivariate time series. If I'm not mistaken, the Kalman filter generates (predicted and updated) process state estimates for each but the first time point. Is it possible to pull these state estimates out online while the data are being filtered?<br />
This would seem to provide the opportunity to include interactions between the (latent) processes over time. Currently, I am allowing the parameters of my bivariate process model (e.g., the auto- and cross-regressive effects) to be moderated by a third observed time-varying variable which I include as fixed. Therefore, temporal dependencies in this third variable, measurement error etc. cannot be accounted for. It would be much more convenient if it could be treated as a (latent) random variable. </p>
<p>Thanks, Janne</p>
<p>PS: Looking forward to the implementation of thresholds for discrete data!</p>
http://openmx.psyc.virginia.edu/thread/3952#commentsOpenMx General HelpFri, 13 Feb 2015 14:05:50 +0000janneadolf3952 at http://openmx.psyc.virginia.eduBackground of data set in OpenMx
http://openmx.psyc.virginia.edu/thread/3951
<p>I can see several twin data sets that come with OpenMx, for example, the DZO data described by following page:</p>
<p><a href="http://openmx.psyc.virginia.edu/docs/OpenMx/latest/_static/Rdoc/dzoData.html" title="http://openmx.psyc.virginia.edu/docs/OpenMx/latest/_static/Rdoc/dzoData.html">http://openmx.psyc.virginia.edu/docs/OpenMx/latest/_static/Rdoc/dzoData....</a></p>
<p>Would anyone please provide more background about this data? The sample size seems to indicate that it is not simulated data, but no descriptions are given for the variables.</p>
<p>I would appreciate it. Thanks.</p>
http://openmx.psyc.virginia.edu/thread/3951#commentsOpenMx General HelpSun, 08 Feb 2015 20:34:02 +0000wuhao_osu3951 at http://openmx.psyc.virginia.eduProblem with definition variables with state space expectation?
http://openmx.psyc.virginia.edu/thread/3948
<p>Am I doing something wrong? I was surprised when my model seemed to be ignoring my definition variables, but then I also notice that mxEval interprets them all as NA... this is using a build from yesterday, 1st Feb 2015, on 64 bit windows.</p>
<p>data(demoOneFactor)<br />
nvar <- ncol(demoOneFactor)<br />
varnames <- colnames(demoOneFactor)<br />
demoOneFactorInputs <- cbind(demoOneFactor, V1=rnorm(nrow(demoOneFactor)))<br />
ssModel <- mxModel(model="State Space Inputs Manual Example",<br />
mxMatrix("Full", 1, 1, TRUE, .3, name="A"),<br />
mxMatrix("Full", 1, 1, TRUE, values=1, name="B"),<br />
mxMatrix("Full", nvar, 1, TRUE, .6, name="C", dimnames=list(varnames, "F1")),<br />
mxMatrix("Zero", nvar, 1, name="D"),<br />
mxMatrix("Diag", 1, 1, FALSE, 1, name="Q"),<br />
mxMatrix("Diag", nvar, nvar, TRUE, .2, name="R"),<br />
mxMatrix("Zero", 1, 1, name="x0"),<br />
mxMatrix("Diag", 1, 1, FALSE, 1, name="P0"),<br />
mxMatrix("Full", 1, 1, FALSE, labels="data.V1", name="u"),<br />
mxData(observed=demoOneFactorInputs, type="raw"),<br />
mxExpectationStateSpace("A", "B", "C", "D", "Q", "R", "x0", "P0", u="u"),<br />
mxFitFunctionML()<br />
)<br />
ssRun <- mxRun(ssModel)</p>
<p>mxEval(data.V1, ssRun, compute=T, defvar.row=1)</p>
http://openmx.psyc.virginia.edu/thread/3948#commentsOpenMx General HelpMon, 02 Feb 2015 12:34:33 +0000CharlesD3948 at http://openmx.psyc.virginia.eduidentifying bivariate outliers
http://openmx.psyc.virginia.edu/thread/3899
<p>Hi,</p>
<p>I am trying to detect and identify bivariate outliers in a dataset using OpenMx, in order to see whether specific outliers have significant contribution. Preferrably the output would be like that of %p in old Mx.<br />
(i.e. 8 columns with:<br />
1) -2lnL,<br />
2) Mahalanobis,<br />
3) estimated Z,<br />
4) number of observations in data set,<br />
5) number of data points in vector,<br />
6) optimization details,<br />
7) whether or not likelihood was calculable, and<br />
8) model number if there are multiple models)</p>
<p>I have already tried using the vector=TRUE argument in FIMLobjective (as suggested in <a href="http://openmx.psyc.virginia.edu/thread/584" title="http://openmx.psyc.virginia.edu/thread/584">http://openmx.psyc.virginia.edu/thread/584</a>), however ID number is not included and I am unsure whether the output is in the same order as in the data file. </p>
<p>Any help would be appreciated, thanks. </p>
http://openmx.psyc.virginia.edu/thread/3899#commentsOpenMx General HelpFri, 26 Sep 2014 01:28:08 +0000ywyh3899 at http://openmx.psyc.virginia.eduCategorical Data in both independent and dependent variables
http://openmx.psyc.virginia.edu/thread/3883
<p>I have a data set with six binary variables, which I am trying to determine the temporal relationship. I was using lavaan R package, where they suggested to use dummy variable for endogenous variables (independent) and use ordered for exogenous (dependent variables). I was using the model as described in pdf file. I have gotten following results: </p>
<p>lavaan (0.5-16) converged normally after 31 iterations</p>
<p> Number of observations 51</p>
<p> Estimator DWLS Robust<br />
Minimum Function Test Statistic 5.699 7.295<br />
Degrees of freedom 7 7<br />
P-value (Chi-square) 0.575 0.399<br />
Scaling correction factor 1.006<br />
Shift parameter 1.632<br />
for simple second-order correction (Mplus variant)</p>
<p>Model test baseline model:</p>
<p> Minimum Function Test Statistic 61.153 45.447<br />
Degrees of freedom 14 14<br />
P-value 0.000 0.000</p>
<p>User model versus baseline model:</p>
<p> Comparative Fit Index (CFI) 1.000 0.991<br />
Tucker-Lewis Index (TLI) 1.055 0.981</p>
<p>Root Mean Square Error of Approximation:</p>
<p> RMSEA 0.000 0.029<br />
90 Percent Confidence Interval 0.000 0.153 0.000 0.178<br />
P-value RMSEA <= 0.05 0.654 0.486</p>
<p>According to lavaan since it was using DWLS, AIC and BIC are calculated. However, we had someone analyze the data before for us was using AIC and BIC to compare which temporal relationship is better at explaining our data. So I decided to try OpenMx, I am very new to path analysis and OpenMx, so I am not quite sure if I am treating the variables correctly. I have attached the code and dataset and the model was run and gave me some estimates, however, RMSEA was not computed. And the estimates for each path was different compared to lavaan. At this point, I am not sure how to compare my results from these two methods and if it's even comparable since OpenMx I turned everything into ordinal but in lavaan I used dummy variables. And why is that OpenMx didn't calcualte RMSEA for categorical data.</p>
<p>rl</p>
<table id="attachments" class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/model.R">model.R</a></td><td>2.79 KB</td> </tr>
<tr class="even"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/Models.pdf">Models.pdf</a></td><td>19 KB</td> </tr>
<tr class="odd"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/path input alt1.csv">path input alt1.csv</a></td><td>707 bytes</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/3883#commentsOpenMx General HelpTue, 26 Aug 2014 21:15:14 +0000rl3883 at http://openmx.psyc.virginia.edumatrix logarithm function for mxAlgebra
http://openmx.psyc.virginia.edu/thread/3459
<p>Any chance of this being implemented at some point? Would seem to be consistent with the omxExponential implementation. Currently I optimize some free parameters over the range 0 to -inf, which is exponentially scaled, and I suspect this probably poses optimization difficulties....</p>
http://openmx.psyc.virginia.edu/thread/3459#commentsOpenMx General HelpThu, 26 Jun 2014 12:10:17 +0000CharlesD3459 at http://openmx.psyc.virginia.eduMultiple group analysis
http://openmx.psyc.virginia.edu/thread/3440
<p>Hi,</p>
<p>I hope this is not asked yet. Is there a maximum number of groups that can be specified with multiple group analysis on OpenMx? For example, 100 groups? And are there special steps to be taken when doing multiple group analysis if a number of groups is exceeded (e.g. 50 or 100)? </p>
<p>Thank you.</p>
<p>metavid</p>
http://openmx.psyc.virginia.edu/thread/3440#commentsOpenMx General HelpWed, 25 Jun 2014 17:48:55 +0000metavid3440 at http://openmx.psyc.virginia.eduDoes OpenMx support multilevel, ordinal/binary outcomes/indicators with sampling weights?
http://openmx.psyc.virginia.edu/thread/3321
<p>Hi,</p>
<p>I am hoping to perform a multilevel SEM on complex-sampling survey data, with known weight and binary outcome and ordinal independent variables. </p>
<p>Similar posts on this forum don't seem to support that this is simple to do on OpenMx, but any advice would be much appreciated. (<a href="http://openmx.psyc.virginia.edu/thread/2348" title="http://openmx.psyc.virginia.edu/thread/2348">http://openmx.psyc.virginia.edu/thread/2348</a>, <a href="http://openmx.psyc.virginia.edu/thread/861#comment-form" title="http://openmx.psyc.virginia.edu/thread/861#comment-form">http://openmx.psyc.virginia.edu/thread/861#comment-form</a>) </p>
<p>Thank you. </p>
http://openmx.psyc.virginia.edu/thread/3321#commentsOpenMx General HelpThu, 19 Jun 2014 18:22:03 +0000yoosoo3321 at http://openmx.psyc.virginia.eduObtain number of Objective function evaluations
http://openmx.psyc.virginia.edu/thread/3122
<p>Hi,</p>
<p>I am interested in obtaining both the number of major iterations and the overall number of objective function evaluations (how many times is the log likelihood and its gradient computed).<br />
I found model@output$iterations and model@output$evaluations. model@output$iterations is the number of major iterations. model@output$evaluations contains a vector with two integer entries. Does somebody know what the entries are?</p>
http://openmx.psyc.virginia.edu/thread/3122#commentsOpenMx General HelpMon, 26 May 2014 16:55:29 +0000jkarch3122 at http://openmx.psyc.virginia.edumodified model
http://openmx.psyc.virginia.edu/thread/2669
<p>hi, I am a beginner using Mx open packages, so I do not quite understand. I have run my program. output is given as attached.<br />
The value of RSMEA, CFI and TLI its very ugly because its value doesn't meet either criteria . What can I do in advance to improve the model?<br />
thank you.</p>
<table id="attachments" class="sticky-enabled">
<thead><tr><th>Attachment</th><th>Size</th> </tr></thead>
<tbody>
<tr class="odd"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/output awal.png">output awal.png</a></td><td>21.41 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/2669#commentsOpenMx General HelpThu, 13 Mar 2014 15:28:39 +0000siti nur azizah2669 at http://openmx.psyc.virginia.eduReferring to an OpenMx matrix in the OpenMx environment
http://openmx.psyc.virginia.edu/thread/2640
<p>I'm trying to run a model in which I have several matrices that should contain the same parameter estimates (they overlap partly). I know I can use labels or mxConstraint to put equality constraints on parameter estimates, but I was wondering if it is also possible to refer directly to the parameter estimates of a matrix in other parts of the OpenMx environment. For example, I have tried to build an mxAlgebra that refers to the parameter estimates of an mxMatrix by using: </p>
<p>mxAlgebra(expression=cbind(Model.mxMatrix[,i],Model.mxMatrix[,j]), name="part_mxMatrix")</p>
<p>but this doesn't seem to work. </p>
<p>If anybody has any suggestion on how to make this work, it is more than welcome!</p>
http://openmx.psyc.virginia.edu/thread/2640#commentsOpenMx General HelpMon, 03 Mar 2014 20:14:39 +0000mverdam2640 at http://openmx.psyc.virginia.eduComputing R squared with missing data
http://openmx.psyc.virginia.edu/thread/2619
<p>This may be an easy question, but I can't think of the answer. I've built a regression model (predicting Y) with two independent variables (X and Z). I want to compute R^2. Is that built into the model somehow? If not, any ideas on how to compute it? Here's the model I have:</p>
<p>multiRegModel <- mxModel("Multiple Regression, All Variables",<br />
type="RAM",<br />
manifestVars=c("x", "y", "z"),<br />
# variance paths<br />
mxPath(<br />
from=c("x", "y", "z"),<br />
arrows=2,<br />
free=TRUE,<br />
values = c(.5, .5, .5),<br />
labels=c("varx", "residual", "varz")<br />
),<br />
# covariance of x and z<br />
mxPath(<br />
from="x",<br />
to="z",<br />
arrows=2,<br />
free=TRUE,<br />
values=0.2,<br />
labels="covxz"<br />
),<br />
# regression weights<br />
mxPath(<br />
from=c("x","z"),<br />
to="y",<br />
arrows=1,<br />
free=TRUE,<br />
values=.5,<br />
labels=c("betax","betaz")<br />
),<br />
# means and intercepts<br />
mxPath(<br />
from="one",<br />
to=c("x", "y", "z"),<br />
arrows=1,<br />
free=TRUE,<br />
values=c(.5, .5),<br />
labels=c("meanx", "beta0", "meanz")<br />
)<br />
) # close model</p>
<p>I know "residual" is the residual variance of Y, but I would think I'd need an estimate of the total variance of Y to compute it from that. Any help would be appreciated. Thanks!</p>
http://openmx.psyc.virginia.edu/thread/2619#commentsOpenMx General HelpMon, 17 Feb 2014 19:06:59 +0000fife2619 at http://openmx.psyc.virginia.edu