General SEM Discussions
http://openmx.psyc.virginia.edu/taxonomy/term/17/0
enLogistic regression correcting for twin data
http://openmx.psyc.virginia.edu/thread/4074
<p>Hi OpenMX community!</p>
<p>I would like to run a simple logistic regression model, but with a classical twin dataset, correcting for the fact that they are twins and their zygosity MZ or DZ. Is there a way for such analysis using OpenMx?</p>
<p>Thanks!</p>
http://openmx.psyc.virginia.edu/thread/4074#commentsGeneral SEM DiscussionsMon, 09 Nov 2015 15:23:56 +0000Cindy.s4074 at http://openmx.psyc.virginia.eduSEM vs MANOVA: What shall I use?
http://openmx.psyc.virginia.edu/thread/4032
<p>Hi guys, </p>
<p>I need help... My PhD thesis is about consumer behaviour analysis. In detail I look at what actions by companies trigger what customer reactions. In my quantitative study, I would like to look at the following dependent variables: </p>
<p>Behavior (with respective items)<br />
Attitude (...)<br />
Emotion (...)</p>
<p>And the following independent variables:</p>
<p>Opportunity for explanation (given/not given)<br />
Alternative presented (yes/no)</p>
<p>My question is... Do I really need SEM? My professor wants me to do so, but I would rather like to use an experimental MANOVA design. </p>
<p>I would appreciate any help!</p>
http://openmx.psyc.virginia.edu/thread/4032#commentsGeneral SEM DiscussionsFri, 28 Aug 2015 16:35:11 +0000ChristophC14032 at http://openmx.psyc.virginia.eduCreating a latent variable for composite variable.
http://openmx.psyc.virginia.edu/thread/4016
<p>Is it possible to take a latent variable (for example Marketing) as for a composite variable which can be measured through its components ( for example promotional expenditure, price discounts etc). We can always argue that Marketing is itself a measured variable but if we take it as a composite function of all the activities that comprises of marketing then is it possible to use it as a latent variable? Will it violate any principles of SEM or factor analysis ?<br />
A quick response will be highly helpful as I'm reaching the deadline of my project submission and I'm stuck due to this problem.<br />
Thank you in advance.</p>
http://openmx.psyc.virginia.edu/thread/4016#commentsGeneral SEM DiscussionsTue, 14 Jul 2015 06:31:44 +0000Sahil1044016 at http://openmx.psyc.virginia.eduObserved variable in structural component of SEM
http://openmx.psyc.virginia.edu/thread/4015
<p>Hi, I'm new to SEM and I'm trying to build a model of marketing mix using sem.<br />
My question is that is it possible to incorporate an observed variable in the structural component of SEM which has an effect on a latent variable or is being affected by a latent variable?<br />
I have attached a pictoral representation of my question.<br />
Please help.<br />
Thank you in advance,<br />
Sahil.</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/image.jpg">image.jpg</a></td><td>1.06 MB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/4015#commentsGeneral SEM DiscussionsTue, 14 Jul 2015 04:54:48 +0000Sahil1044015 at http://openmx.psyc.virginia.eduImportance of a path v/s factor
http://openmx.psyc.virginia.edu/thread/4009
<p>Hello!</p>
<p>I have a very general question that I would like to seek some help with. I know that the direct\indirect impacts for each variable in the model can be computed using a multiplication rule. However, this gives us the importance of the variable and not the path. How can I understand the importance of the path, should I simply add the co-efficients?</p>
<p>I would really appreciate a quick revert!</p>
<p>Thanks,<br />
Vaibhav</p>
http://openmx.psyc.virginia.edu/thread/4009#commentsGeneral SEM DiscussionsThu, 18 Jun 2015 07:01:26 +0000LearnSEM84009 at http://openmx.psyc.virginia.eduModel with latent variables
http://openmx.psyc.virginia.edu/thread/4008
<p>Hello!</p>
<p>I have a very general question regarding Covariance based SEMs. I have a full SEM model (with latent variables) and my client is wondering how a change in one attribute for one of the factors could affect the end dependent variable. Are standard SEM methodologies capable of answering this question? If so, how should I approach it?</p>
<p>A quick revert will be really helpful! Thanks!</p>
http://openmx.psyc.virginia.edu/thread/4008#commentsGeneral SEM DiscussionsWed, 17 Jun 2015 16:53:56 +0000LearnSEM84008 at http://openmx.psyc.virginia.eduPosterior predictive distribution and SEM
http://openmx.psyc.virginia.edu/thread/3991
<p>In short my question is: Are posterior predictive distributions used in the SEM world? If yes, under which name und for what purpose?</p>
<p>Let <img src=http://openmx.psyc.virginia.edu/sites/default/files/1_1.png /> be an SEM. Lets say there are a lot of missing values in our observed sample y. We can still get a maximum likelihood estimate for \hat{theta} using FIML. Thus, we get a fitted SEM, or in other words a multivariate normal distribution <img src=http://openmx.psyc.virginia.edu/sites/default/files/2_1.png />. Lets now say that I partition my data set y into all values that are missing a and all values that are not missing b. Thus, y=[a b]. I can then get the conditional distribution of a given b using my fitted SEM. A bayesian would call this the posterior predictive distribution.</p>
<p>I understand that in this <a href="http://openmx.psyc.virginia.edu/thread/3977">thread</a> RobK proposes to use the posterior predictive distribution for prediction in this <a href="http://openmx.psyc.virginia.edu/thread/3977#comment-5986">post</a>. Michael gives a first hint that using the posterior predictive distribution might be equivalent to "EM imputation of missing data using the model-implied covariance and means as the imputation model" in this <a href="http://openmx.psyc.virginia.edu/thread/3977#comment-5987">post</a>. Can somebody elaborate on that? Do you know of other techniques that are commonly used by SEM researchers that employ the posterior predictive distribution?</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/1_1.png">1.png</a></td><td>3.34 KB</td> </tr>
<tr class="even"><td><a href="http://openmx.psyc.virginia.edu/sites/default/files/2_1.png">2.png</a></td><td>2.98 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/3991#commentsGeneral SEM DiscussionsWed, 20 May 2015 17:59:16 +0000jkarch3991 at http://openmx.psyc.virginia.eduHow to conduct SEM on multiple datasets resulting from MI?
http://openmx.psyc.virginia.edu/thread/3983
<p>Hi, forgive me if you see duplicate messages. I previously posted the question on my last thread. But I think it's more proper to make it as a new topic. </p>
<p>My question is like this：Since I want the missing value of my dataset, whereas FIML doesn't provide that, I chose multiple imputation (MI) to deal with my missing data instead of FIML. The problem is after MI (say, I did 5 imputations), I get 5 imputed datasets. How can I use these datasets to build SEM? Shall I conduct SEM on each imputed dataset separately? If so, how can I combine the model parameters and model fitness indice (e.g. TLI, CFI, RMSEA)?</p>
<p>I find there is one previous thread in this forum talking about the same problem: <a href="http://openmx.psyc.virginia.edu/thread/118" title="http://openmx.psyc.virginia.edu/thread/118">http://openmx.psyc.virginia.edu/thread/118</a> . It tells that OpenMx cannot deal with the multiple imputed datasets directly, we need to do the combination manually. Can I know the details how to do this manually? Do we conduct SEM separately on each imputed dataset and average all the parameters and weights? Thanks in advance. </p>
http://openmx.psyc.virginia.edu/thread/3983#commentsGeneral SEM DiscussionsThu, 07 May 2015 13:38:30 +0000jasperrr3983 at http://openmx.psyc.virginia.eduFactor loadings are regression coefficients
http://openmx.psyc.virginia.edu/thread/3980
<p>I’m a PhD student in the field of economics very new using SEM and MX software. </p>
<p>I’d appreciate your feedback with regard to the following basic questions.</p>
<p>Let’s construct a SEM model where 3 measurable variables: X, Y and Z interact with a latent variable G and assume that the factor loadings of latent variable G over the measurable variables X, Y and Z are 0.3, 0.4 and 0.1 respectively. The model is constructed sourced on the correlation matrix (3x3) of the measurable variables.</p>
<p>Then, as far as factor loadings are considered as regression coefficients:</p>
<p>Question 1: could I estimate that G = 0.3*X + 0.4*Y + 0.1*Z?</p>
<p>Question 2: could you confirm me whether the obtained regression coefficients sourced on the correlation matrix are standardized or unstandardized coefficients?</p>
<p>Thanks</p>
http://openmx.psyc.virginia.edu/thread/3980#commentsGeneral SEM DiscussionsWed, 29 Apr 2015 15:27:16 +0000jmatosv3980 at http://openmx.psyc.virginia.eduHow can I use SEM to predict variable scores
http://openmx.psyc.virginia.edu/thread/3977
<p>Hi all, I have built a SEM model as attached image. There are five variables, and one modulation factor. </p>
<p>If I know four of the five variables, can I use the model to predict the 5th variable? How can I do this?</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/SEM3.jpg">SEM3.jpg</a></td><td>57.43 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/3977#commentsGeneral SEM DiscussionsWed, 22 Apr 2015 00:47:34 +0000jasperrr3977 at http://openmx.psyc.virginia.eduProblems with model fit
http://openmx.psyc.virginia.edu/thread/3965
<p>This is what i wrote for my model specification but I'm getting this error<br />
2: In eval(expr, envir, enclos) :<br />
Could not compute QR decomposition of Hessian.<br />
Optimization probably did not converge.</p>
<p>> model.dhp <- specifyModel ()<br />
1: EA_response -> EA_survival,NA,1<br />
2: EA_response -> EA_progeny,gam12<br />
3: EA_response -> EA_progeny_wet_mass,gam13<br />
4: EA_response -> EA_progeny_dry_mass,gam14<br />
5: FC_response -> FC_survival,NA,1<br />
6: FC_response -> FC_progeny,gam22<br />
7: BA_response -> Ba_emergence,NA,1<br />
8: BA_response -> Ba_shoot_length,gam32<br />
9: BA_response -> Ba_root_length,gam33<br />
10: BA_response -> Ba_shoot_dry_mass,gam34<br />
11: BA_response -> Ba_root_dry_mass,gam35<br />
12: NWG_response ->NWG_emergence,NA,1<br />
13: NWG_response ->NWG_shoot_length,gam42<br />
14: NWG_response ->NWG_root_length,gam43<br />
15: NWG_response ->NWG_shoot_dry_mass,gam44<br />
16: NWG_response ->NWG_root_dry_mass,gam45<br />
17: Alf_response ->Alf_emergence,NA,1<br />
18: Alf_response ->Alf_shoot_length,gam52<br />
19: Alf_response ->Alf_root_length,gam53<br />
20: Alf_response ->Alf_shoot_dry_mass,gam54<br />
21: Alf_response ->Alf_root_dry_mass,gam55<br />
22: Agg.Response -> EA_response,NA,1<br />
23: Agg.Response -> FC_response,lam1<br />
24: Agg.Response -> BA_response,lam2<br />
25: Agg.Response -> NWG_response,lam3<br />
26: Agg.Response -> Alf_response,lam4<br />
27: EA_progeny <-> EA_progeny, theta21, NA<br />
28: EA_progeny_dry_mass <-> EA_progeny_dry_mass, theta22, NA<br />
29: EA_progeny_wet_mass <-> EA_progeny_wet_mass, theta23, NA<br />
30: FC_progeny <-> FC_progeny, theta24, NA<br />
31: FC_survival <-> FC_survival, theta25, NA<br />
32: Ba_emergence <-> Ba_emergence, theta26, NA<br />
33: Ba_root_dry_mass <-> Ba_root_dry_mass, theta27, NA<br />
34: Ba_root_length <-> Ba_root_length, theta28, NA<br />
35: Ba_shoot_dry_mass <-> Ba_shoot_dry_mass, theta29, NA<br />
36: Ba_shoot_length <-> Ba_shoot_length, theta30, NA<br />
37: NWG_emergence <-> NWG_emergence, theta31, NA<br />
38: NWG_root_dry_mass <-> NWG_root_dry_mass , theta32, NA<br />
39: NWG_root_length <-> NWG_root_length, theta33, NA<br />
40: NWG_shoot_dry_mass <-> NWG_shoot_dry_mass, theta34, NA<br />
41: NWG_shoot_length <-> NWG_shoot_length, theta35, NA<br />
42: Alf_emergence <-> Alf_emergence, theta36, NA<br />
43: Alf_root_dry_mass <-> Alf_root_dry_mass, theta37, NA<br />
44: Alf_root_length <-> Alf_root_length, theta38, NA<br />
45: Alf_shoot_dry_mass <-> Alf_shoot_dry_mass, theta39, NA<br />
46: Alf_shoot_length <-> Alf_shoot_length, theta40, NA<br />
47: EA_Response <-> EA_Response, theta41, NA<br />
48: FC_Response <-> FC_Response, theta42, NA<br />
49: BA_Response <-> BA_Response, theta43, NA<br />
50: NWG_Response <-> NWG_Response, theta44, NA<br />
51: Alf_Response <-> Alf_Response, theta41, NA<br />
52: Agg.Response <-> Agg.Response, NA, 1<br />
53:</p>
<p>Read 52 records<br />
NOTE: it is generally simpler to use specifyEquations() or cfa()<br />
see ?specifyEquations<br />
NOTE: adding 6 variances to the model</p>
<p>> out<-sem(model.dhp,datacov,N=34)<br />
Warning messages:<br />
1: In sem.semmod(model.dhp, datacov, N = 34) :<br />
The following observed variables are in the input covariance or raw-moment matrix but do not appear in the model:<br />
Soil, Soil.1, Rep, F2, F3, F4, Soil_Moisture, pH, Conductivity, WHC, Total_Nitrogen, Total_Carbon, InCarbon, OrgCarbon, Phosphorous, Organic_Matter, Gravel, Sand, VeryFineSand, FineSand, MediumSand, CoarseSand, VCourseSand, Silt, Clay</p>
<p>2: In eval(expr, envir, enclos) :<br />
Could not compute QR decomposition of Hessian.<br />
Optimization probably did not converge.</p>
http://openmx.psyc.virginia.edu/thread/3965#commentsGeneral SEM DiscussionsThu, 12 Mar 2015 22:48:43 +0000Idunnu3965 at http://openmx.psyc.virginia.eduFactor analysis with weights
http://openmx.psyc.virginia.edu/thread/3954
<p>I have a question. I looked at the package sem and lavaan.survey for the factor analysis but sem doesn't support weights and lavaan.survey doesn't have FIML. Without FIML, lavaan.survey was still able to do the job of getting the expected graphs (smooth curves) but with OpenMx, it does not work. I get straight lines.</p>
<p>The code is below and the data set is in the attachment. I don't know if the weights are calculated with the data in the analysis.</p>
<p>dsetA <- read.table("dsetA.txt",sep="")<br />
# Possible values of the weighting variable<br />
valm <- seq(21,40,by=1/10)<br />
# Weight matrix: Use radial basis function<br />
library(kernlab)<br />
matx <- as.matrix(valm)<br />
rbf <- rbfdot(sigma = 1)<br />
kerm <- kernelMatrix(rbf, matx)<br />
vali <- seq(1,191,by=10) #indices of the valm in the matrix<br />
matn <- kerm[vali,]<br />
wmat <- matrix(NA,nrow=nrow(dsetA),ncol=191)<br />
# Size per value of weighting variable<br />
ws <- c(199,258,289,316,414,230,225,213,225,278,316,345,321,193,332,317,326,228,297,311)<br />
for(i in 1:191){wmat[,i] <- rep(matn[,i],ws)} #kernel weights<br />
wmat[wmat < 0.0001] <- 0<br />
# Data per value of the weighting variable<br />
dataNeo <- replicate(191,list())<br />
for(i in 1:191){dataNeo[[i]] <- data.frame(dsetA[,c("neo1","neo2","neo3","neo4","neo5","neo6","neo7","neo8")],wmat[,i])<br />
names(dataNeo[[i]]) <- c("neo1","neo2","neo3","neo4","neo5","neo6","neo7","neo8","weight")}<br />
# Item names<br />
neodim <- c("neo1","neo2","neo3","neo4","neo5","neo6","neo7","neo8")<br />
require(OpenMx)<br />
FNeo <- mxModel("neoanal",<br />
mxMatrix( type="Full", nrow=8, ncol=1, values=rep(1,8), free=c(T,T,F,rep(T,5)),lbound = c(NA,rep(0.01,7)), name="facneo" ),<br />
mxMatrix( type="Symm", nrow=1, ncol=1, values=2, free=T, lbound=0.01,name="fvarneo" ),<br />
mxMatrix( type="Diag", nrow=8, ncol=8, free=T, values=rep(1,8), lbound = rep(0.01,8),<br />
name="resneo" ),<br />
mxMatrix( type="Full", nrow=1, ncol=8, values=c(2,2,0,rep(2,5)), free=c(T,T,F,rep(T,5)), lbound = c(-5,-5,NA,rep(-5,5)), name="intneo" ),<br />
mxMatrix( type="Full", nrow=1, ncol=1, values=4, free=T, lbound = 0.01,name="fmeanneo" ),<br />
mxAlgebra( expression= facneo %&% fvarneo + resneo,<br />
name="covneo" ),<br />
mxAlgebra(expression= intneo + t(facneo %*% fmeanneo),<br />
name="meanneo" ),<br />
mxFIMLObjective( covariance="covneo", means="meanneo", dimnames=neodim,vector=TRUE)<br />
)<br />
neoms <- replicate(191,list())<br />
for(i in 1:191){neoms[[i]] <- mxModel(paste("neofactor",i,sep=""),FNeo,mxData(dataNeo[[i]], type="raw"),<br />
mxAlgebra(-2 * sum(data.weight %x% log(neoanal.objective)), name = "neoobj"),mxAlgebraObjective("neoobj"))}<br />
parneo <- list()<br />
for(i in 1:191) {parneo[[i]] <- omxGetParameters(mxRun(neoms[[i]]))}<br />
#Example graph<br />
parplot <- numeric(191)<br />
for(i in 1:191){parplot[i] <- parneo[[i]][1]}<br />
plot(parplot,type="l",col=6,lwd=1.5,ylim=c(0.60,0.70) </p>
<p>The graph is not a smooth curve?</p>
<p>Thanks.</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/dsetA.txt">dsetA.txt</a></td><td>192.76 KB</td> </tr>
</tbody>
</table>
http://openmx.psyc.virginia.edu/thread/3954#commentsGeneral SEM DiscussionsWed, 18 Feb 2015 20:07:40 +0000arjenc3954 at http://openmx.psyc.virginia.edurandom 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.edu