General SEM Discussions
http://openmx.psyc.virginia.edu/taxonomy/term/17/0
enrandom variance parameters, or approximations of such?
http://openmx.psyc.virginia.edu/thread/3915
<p>Hi all. So I'm taking a look at a dataset of about 200 individuals, each with a number of variables measured 50 times longitudinally. A lot of these variables are scored on a scale of 0-100, which 'seems' to have created large differences in scale usage - differences that are no doubt normally there with a 0-10 scale but are probably emphasised now. If the measurement model were equivalent across individuals, then the structural model is clearly not anyway, so I have a similar issue, or probably both measurement and structural differences. Nevertheless, I want to estimate the dynamic parameters which characterise the processes, using autoregressive / cross regressive type models.</p>
<p>I see a few easy options:</p>
<p>Estimate all parameters separately for every individual - but this will badly overfit and I expect?? parameters to become relatively meaningless.</p>
<p>Constrain parameters governing relationships in time across the sample, free the intercept, latent and manifest error variances across individuals (though still constrained over time). This is probably better, but again, I suspect this will overfit, and I've seen similar overfit heavily bias dynamic parameters.</p>
<p>a somewhat trickier option I don't have much confidence in would be to generate an additional manifest variable, such as 'variance', treat it as perfectly measured, and use it as a definition variable (along with an estimated param for the moderating relationship) moderating the variance parameters I need moderated. </p>
<p>I think my ideal solution is random variance parameters - do I need to go and learn how to write up my problem in Stan (bayesian), are there potentially good solutions possible within OpenMx I haven't considered, or are perhaps some of those I have considered more workable than I suspect? Would love to hear any thoughts, thanks!</p>
http://openmx.psyc.virginia.edu/thread/3915#commentsGeneral SEM DiscussionsFri, 24 Oct 2014 20:52:38 +0000CharlesD3915 at http://openmx.psyc.virginia.edu"Observed" correlation matrix with missing data--is it computed?
http://openmx.psyc.virginia.edu/thread/3907
<p>I've got a bit of an unusual question. I have missing data and I'm taking advantage of FIML's algorithms to handle that missingness. I know the EM algorithm will return a "corrected" correlation or covariance matrix. Will FIML do the same? I know it returns corrected model estimates, but I can't see how I'd extract the corrected correlation matrix. When I type:</p>
<p>model$data</p>
<p>It returns the raw dataset (with missing values still missing). </p>
<p>Any ideas?</p>
http://openmx.psyc.virginia.edu/thread/3907#commentsGeneral SEM DiscussionsFri, 10 Oct 2014 14:20:49 +0000fife3907 at http://openmx.psyc.virginia.eduAIC/BIC is NA, but other FIs are computed
http://openmx.psyc.virginia.edu/thread/3904
<p>Hi all,</p>
<p>I've run a model and am a bit puzzled that it won't give me the information criteria (AIC and BIC). Everything else is computed, including chi, k, and df, which are the sufficient statistics. Am I missing something? I've included a screenshot. It seems the AIC should be</p>
<p>1557.625 + ncol(d)*(ncol(d)-1)-2*453 = 1707.625,<br />
where ncol(d) = 33</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/Screen Shot 2014-09-30 at 12.48.51 PM.png">Screen Shot 2014-09-30 at 12.48.51 PM.png</a></td><td>44.35 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/3904#commentsGeneral SEM DiscussionsTue, 30 Sep 2014 17:50:40 +0000fife3904 at http://openmx.psyc.virginia.eduBootstrapping for confidence bands of parameters
http://openmx.psyc.virginia.edu/thread/3885
<p>Good day,</p>
<p>For my data set, I have to generate confidence bands for a number of parameters. I already did empirical bootstrapping via the function umxCI_boot from the package 'umx'. My data set contains a number of missing values (with FIML used for the model estimation) so when I did empirical bootstrapping, it stated a warning indicating the presence of missing values in the observed covariance matrix, making it non-positive-definite so the empirical bootstrapping did not proceed. </p>
<p>My question is: What would be the next sensible thing to do? Use parameteric Monte-Carlo bootstrapping instead based on the expected covariance matrix? With the observed covariance matrix containing missing values, doing parametric Monte-Carlo bootstrapping on it might be futile.</p>
<p>Thank you for your feedback.</p>
<p>metavid </p>
http://openmx.psyc.virginia.edu/thread/3885#commentsGeneral SEM DiscussionsWed, 27 Aug 2014 22:37:09 +0000metavid3885 at http://openmx.psyc.virginia.eduLatent Variable Indicators
http://openmx.psyc.virginia.edu/thread/3875
<p>Can an indicator for a latent variable be used elsewhere in the structural part of a structural equations model as an independent variable? I think the answer is no, as I've not seen it done, but would like to check.</p>
<p>Thanks for any help</p>
http://openmx.psyc.virginia.edu/thread/3875#commentsGeneral SEM DiscussionsTue, 19 Aug 2014 15:15:58 +0000moman8223875 at http://openmx.psyc.virginia.eduProblems with convergence when parameters are fixed and question about BIC
http://openmx.psyc.virginia.edu/thread/3871
<p>Good day,</p>
<p>I am having some trouble with posting due to the spam filter being continuously triggered so I also provided an attachment for the R code in addition to the data set.</p>
<p>I have two different questions.<br />
My questions revolve around multiple group factor analysis (3 groups). There are a lot more groups but for the sake of the questions and computation speed, I provided the code for three groups.<br />
Thank you for your suggestions and comments.</p>
<p>1. Fixing of model parameters: I fixed all the parameters in a one factor model. The code works for one group (model1) but when three groups are put into one entire run of code (mgroups), I get the warning: "Error: The job for model 'new' exited abnormally with the error message: Objective function returned a value of NaN at iteration 0.1." How could I circumvent this issue to let the code work for the three groups in one run?</p>
<p>2. Total of BIC from one entire code run unequal with the sum of BIC from individual models<br />
I would like to compute the information criteria using three groups in one whole code. I specified the code for three groups in one run (newmodel) and the code for three separate groups (m1,m2,m3). I further specified the code below to compute the information criteria. The thing is, the sum of the AIC's from three separate model is exactly equal with the AIC computed from one entire code run (newmodel) but it is not the case for the BIC's. They do not correspond at all. Is the BIC computed differently when multiple groups are specified in one code or is it just ordinary to find that the sum of the BIC's from separate groups does not equal the BIC when the three groups are combined in one code?</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/codemx.txt">codemx.txt</a></td><td>9.03 KB</td> </tr>
<tr class="even"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/dataset_1.txt">dataset.txt</a></td><td>11.71 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/3871#commentsGeneral SEM DiscussionsThu, 14 Aug 2014 02:31:56 +0000metavid3871 at http://openmx.psyc.virginia.eduAutomatically computing residual variances for a specified RAM matrix
http://openmx.psyc.virginia.edu/thread/3866
<p>It seems I'm frequently wanting to compute an implied correlation matrix given a SE model. I began writing a function to do just that:</p>
<p>#### create a RAM model for testing<br />
RAM = data.frame(matrix(c(<br />
"F1", "A1", 1, .4,<br />
"F1", "A2", 1, .4,<br />
"F1", "A3", 1, .4,<br />
"F2", "A4", 1, .4,<br />
"F2", "A5", 1, .4,<br />
"F2", "A6", 1, .4,<br />
"F3", "A7", 1, .4,<br />
"F3", "A8", 1, .4,<br />
"F3", "A9", 1, .4,<br />
"A10", "A9", 2, .5), ncol=4, byrow=T<br />
))<br />
names(RAM) = c("From", "To", "Arrows", "Values")</p>
<p>####<br />
observed = c("A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10")</p>
<p>### begin function (currently omitted until done testing)<br />
#ram.2.cor = function(RAM, observed){</p>
<p> all.vars = as.character(unique(unlist(c(RAM[,1:2]))))<br />
unobserved = as.character(all.vars[which(!(all.vars%in%observed))])</p>
<p> #### create asymmetric matrix<br />
mA = data.frame(matrix(0,nrow=length(all.vars), ncol=length(all.vars)), row.names=c(observed, unobserved))<br />
names(mA) = c(observed, unobserved)<br />
for (j in 1:nrow(RAM)){<br />
col = which(names(mA) == RAM$From[j] & RAM$Arrows[j] == 1)<br />
rw = which(names(mA) == RAM$To[j] & RAM$Arrows[j] == 1)<br />
mA[rw, col] = as.numeric(RAM$Values[j])<br />
}</p>
<p> ##### create symmetric matrix (temporarily fill in endogenous variances)<br />
end = names(mA)[which(rowSums(mA)>0)]<br />
mS = data.frame(diag(length(all.vars)), row.names=c(observed, unobserved))<br />
names(mS) = row.names(mS)<br />
for (i in 1:nrow(RAM)){<br />
if (RAM$Arrows[i] == 2){<br />
col = which(names(mA) == RAM$To[i])<br />
row = which(names(mA) == RAM$From[i])<br />
mS[col,row] = as.numeric(as.character(RAM$Values[i]))<br />
mS[row,col] = as.numeric(as.character(RAM$Values[i]))<br />
}<br />
}<br />
#### I'M STUCK!</p>
<p>The code above produces the asymmetrical matrix and is almost there for the symmetric matrix. However, all the variances are set to one. I want all variables to have a total variance of one, which means that the endogenous variables will have a value < 1. In the past, I've just used covariance algebra to compute them, but this becomes unrealistic for large models and cannot be put into a function. </p>
<p>So....can you all think of any general equation that will tell me what value for the residual variance will give each variable a total variance of one? I was considering using optim to solve it through brute force, but I figured there had to be a more elegant way of doing it. </p>
<p>Thanks!</p>
<p>P.S....sorry if this is totally obvious. I reserve the right to overlook a very simple answer.<br />
}</p>
http://openmx.psyc.virginia.edu/thread/3866#commentsGeneral SEM DiscussionsTue, 05 Aug 2014 17:30:56 +0000fife3866 at http://openmx.psyc.virginia.eduLatent Variable Usage
http://openmx.psyc.virginia.edu/thread/3863
<p>Hello,</p>
<p>Does the scale of a latent variable matter in interpreting results? For instance, I am trying to make a latent variable for cost, but none of my observed variables are in dollars (or any monetary value). If the first indicator loading is fixed to 1, but that is measuring # of cars, how would that affect the other indicators, which are measurements of completely different things (but things that would affect this idea of cost)?</p>
<p>Thanks for any help</p>
http://openmx.psyc.virginia.edu/thread/3863#commentsGeneral SEM DiscussionsFri, 01 Aug 2014 21:06:59 +0000moman8223863 at http://openmx.psyc.virginia.eduPrevent Calculation of Auxiliary Variable Descriptive Statistics
http://openmx.psyc.virginia.edu/thread/3127
<p>Hi All,</p>
<p>I am using OpenMx in conjunction with SEM Trees. As a result of this, I have to include the whole dataset (30,000 x 1200). Right now, it takes about 30 seconds to run the current code:</p>
<p>hpc20 <- mxModel("1 Variable",type="RAM",<br />
mxData(observed=pt_run1,type="raw"),<br />
manifestVars="A_AbsRea",<br />
mxPath(<br />
from= "A_AbsRea" ,<br />
arrows=2,free=T,values=9,labels= "e1"),<br />
mxPath(<br />
from="one",<br />
to="A_AbsRea",<br />
arrows=1,free= T,values= 8,labels = "mean1")) </p>
<p>system.time(hpc20Fit <- mxRun(hpc20,suppressWarnings=T,silent=T))<br />
user system elapsed<br />
30.723 2.092 32.806 </p>
<p>I am trying to figure out a way to speed this up. Because the computation takes so long in using SEM Trees with such a large dataset, we are starting with the simplest possible model. I suspect the model takes so long to run because of the computation of the descriptives for all of the other variables. When the dataset is changed to just include the one variable, it takes a split second. </p>
<p>I have tried to change this option thus far:</p>
<p>hpc20 <- mxOption(hpc20,'No Sort Data',"A_AbsRea")</p>
<p>although it doesn't off change the computation time. Is there a different way to have OpenMx only calculate values for the 1 variable of interest? Sorry if I am not clear or am missing something quite obvious.</p>
<p>Thanks<br />
Ross</p>
http://openmx.psyc.virginia.edu/thread/3127#commentsGeneral SEM DiscussionsTue, 27 May 2014 20:35:14 +0000jacobucc3127 at http://openmx.psyc.virginia.eduhow to make fit model?
http://openmx.psyc.virginia.edu/thread/2966
<p>hallo,<br />
I want to ask about optimalization my SEM model. i confused how to set a starting value for each variable? i send my code but in result, i get still NaN in the standar estimation.<br />
in my result, RMSEA still more than 0.08 and the CFI still less than 0.9. so, what should i do?</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_0.txt">OUTPUT.txt</a></td><td>9.76 KB</td> </tr>
<tr class="even"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/kodingan data Yogya Bali (DataFilter)1.txt">kodingan data Yogya Bali (DataFilter)1.txt</a></td><td>4.39 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/2966#commentsGeneral SEM DiscussionsWed, 30 Apr 2014 08:02:10 +0000siti nur azizah2966 at http://openmx.psyc.virginia.eduPower calculation
http://openmx.psyc.virginia.edu/thread/2959
<p>Hi.<br />
We are planning to do some moderation model analysis on the new data (which we do not have yet) and need to do power analysis before. Is there any script written for OpenMx how to do it? I found some scripts for calssical Mx, but I am not sure I am able to adjust it to moderation models and even if, the output seems to be not compatible with 64-bit Windows.<br />
I would appreciate any help for simulating data driven by such models and for calculating the power.<br />
Thank you beforehand!<br />
Julia</p>
http://openmx.psyc.virginia.edu/thread/2959#commentsGeneral SEM DiscussionsTue, 29 Apr 2014 09:20:03 +0000Julia2959 at http://openmx.psyc.virginia.eduSEM for prediction
http://openmx.psyc.virginia.edu/thread/2750
<p>Hello -</p>
<p>I wanted to check with the community if anyone has experience in using SEM for predictive modeling. If yes, how does one approach it. Thanks in advance for your help!</p>
http://openmx.psyc.virginia.edu/thread/2750#commentsGeneral SEM DiscussionsMon, 31 Mar 2014 04:07:41 +0000LearnSEM82750 at http://openmx.psyc.virginia.eduSet starting values
http://openmx.psyc.virginia.edu/thread/2712
<p>I want to ask what exactly the purpose of setting the starting value in mxPath codes? And what the basic can we use to set it? Is it like trial and error? I set some values but it always generate the NaN value in standard error, so what should I do then? Thank you.</p>
http://openmx.psyc.virginia.edu/thread/2712#commentsGeneral SEM DiscussionsTue, 25 Mar 2014 11:47:50 +0000icha2712 at http://openmx.psyc.virginia.eduFIML Estimation
http://openmx.psyc.virginia.edu/thread/2705
<p>I want to ask you.<br />
actually, I have a problem with my data. My new data is incomplete (missing data). I read on the web if no data is lost then using FIML function, but I am confused what to put where and what. I have tried but I always fail. please help me.<br />
other than that, is there any basis we determine the value? I tried to try to change the value of 0.25-1 and outcome affect the output Standard error of estimate.<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/kodingan DATA BARU YogyaPabar.txt">kodingan DATA BARU YogyaPabar.txt</a></td><td>4.8 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/2705#commentsGeneral SEM DiscussionsTue, 25 Mar 2014 05:23:22 +0000siti nur azizah2705 at http://openmx.psyc.virginia.eduGrowth curve model with ordinal data!
http://openmx.psyc.virginia.edu/thread/2672
<p>Hi,<br />
I have 50 binary variables with values of either 0 or 1. I tried to treat these variables as ordinal and fit a growth curve model.<br />
OpenMx gave wrong message:</p>
<p>Running Linear Growth Curve Model<br />
Error: The data object 'Linear Growth Curve Model.data' contains 50 ordered factors but our ordinal integration implementation has a limit of 20 ordered factors.</p>
<p>Is that true that I only can fit 20 ordered factors using OpenMx? Could you point me a direction how to fix this problem? Any help or suggestions will be appreciated. Thanks!</p>
http://openmx.psyc.virginia.edu/thread/2672#commentsGeneral SEM DiscussionsFri, 14 Mar 2014 13:55:47 +0000Sunny Wu2672 at http://openmx.psyc.virginia.edu