I really appreciate the new Bayesian features in Mplus 6.1.
However, I have a quick query: I am struggling to achieve convergence (psr<=1) when using Bayesian estimation with informative priors on a CFA. As with ML, would adding plausible starting values to the model help achieve convergence? Many Thanks
Yes, it does. You can also try using STVALUES = ML in the ANALYSIS command. I typically don't see that much of convergence problems with Bayes. An exception of course is if the model is not identified, or identified only with informative priors and they have too large variances.
Mike Zyphur posted on Tuesday, March 13, 2012 - 8:30 pm
Hi Bengt, Have you noticed shorter estimation times in very complex models using such empirical priors? They would seem to reduce the need for a substantial burn in phase.
Below syntax is based on your example 9.19. Could you tell me which statements I need to add to check measurement invariance confer the third example in 'Bayesian SEM: A more flexible representation'? I found file 'run23' of that paper, but have no idea how to implement it in this multilevel analysis. Any suggestions are welcome. Many thanks, Luk
Thanks for your prompt reply. The main covariate of interest is 'func'. This is coded as 0 for staff and 1 for their chiefs (with exactly one chief in each unit). I see that the factor means of chiefs are for all but one factor on the within level significantly higher. Now I want to know that I'm not comparing apples and oranges like Linda says in the webvideo. The 'third example' I use for reference is 'Study 3: Direct effects in MIMIC modeling' from the BSEM paper, from which you concluded 'This illustrates the importance of allowing for all possible direct effects using informative, small-variance priors.' How can I implement this in my model? Also, since I use RANDOM, is there no way to reproduce Table 23 from the BSEM paper? So I stick to EFA for the factor loadings confer Table 22 of your paper?
Thank you, that helped a lot. My final model is a two-level Bayesian mimic model with cross-loadings and direct effects with zero mean and small-variance priors. I have three questions related to this:
1. In my output I don't get PPC. What could be the reason? 2. Apologies, but I'm still confused what I can conclude from a mimic model regarding the factor structure across groups. In your 1989 Psychometrika paper (latent variable modeling in...) I read on page 563 that it allows an investigation of hypotheses of construct validity and invariance across subpopulations. I get the invariance part, but how does this relate to construct validity exactly? Is that because the direct effects of covariates on items are tested over and above the indirect effect via the factors? Or, in the Topic 1 slides (slide 175) it says that the model ASSUMES the same factor loadings, observed residual variances/covariances, factor variances and covariances for all levels of the covariates. Should I thus first do a MGCFA? 3. If I have multiple covariates I want to test, would you recommend first testing them all seperately, or immediately all together?
1. We have not yet implemented PPC for multilevel models.
2. I would forget about the construct validity issue here - you are testing for invariance. MIMIC assumes what you mention, but that doesn't mean you have to do MGFA to check that. Just look at the MIMIC approach as an approximate way to discover major non-invariance in the intercepts.
3. In MIMIC I would do them all together, which is the strength of MIMIC.
Im having difficulty obtaining a Posteria Predictive P-value for my CFA model.
Variable: Names are crisis people resource future disaster cntrysde control priority species id; Missing are all (-9999) ; USEV = crisis people resource future disaster cntrysde control priority species;
DEFINE: STANDARDIZE crisis people resource future disaster cntrysde control priority species;
Model: f1 BY crisis* future control priority; f2 BY disaster* resource people; f3 BY cntrysde* species; f1-f3@1;
!CROSS-LOADINGS: f1 BY disaster resource people cntrysde species*0 (a5-a9); f2 BY crisis future control priority*0 (b1-b4); f2 BY cntrysde species*0 (b8-b9); f3 BY crisis future control priority disaster resource people*0 (c1-c7);
I then ran a basic version of the model without crossloadings using the syntax below and had the same problem.
Variable: Names are crisis people resource future disaster cntrysde control priority species id; Missing are all (-9999) ; USEV = crisis people resource future disaster control priority cntrysde species; CATEGORICAL are crisis people resource future disaster control priority cntrysde species;
DEFINE: STANDARDIZE crisis people resource future disaster cntrysde control priority species;
ANALYSIS: ESTIMATOR = bayes; PROCESSORS = 2;
Model: f1 BY crisis future control priority; f2 BY disaster resource people; f3 BY cntrysde species;
I have run each factor individually, and each produces good ppp values.
I also ran the entire model with ML estimation, which appears to run fine. Goodness of fit statistics indicate the model is good.
I have re-checked the data in STATA and cannot see a problem.
I completed a study with a Bayesian 2-level MIMIC model. Covariates are at the lowest level. My findings are very interesting in that I find significant effects for the main covariate of interest on several latent variables. More concretely, I find that nurse managers compared to staff nurses have consistenty higher ratings of several aspects of nurses' work environment. One could say that nurse managers don't seem to grasp what is going on.
I hypothesize that this would lead to decreased wellbeing among nurses. So is there any way that I could model this (thus add an outcome variable to this model)?
You should ask this on a general discussion forum like SEMNET or Multilevelnet.
an-tsu chen posted on Thursday, November 28, 2013 - 1:55 am
When doing Bayesian estimation, we often choose the inverse-wishart distribution when modeling the normal covariance matrix. But what if some of the variables are categorical? Does this case change the way we assign parameters to the IW distribution?
I have already referred to the User's Guide but did not see any information addressing this, so I came here to ask this question. Thank you!!
With categorical variables you can still use IW priors for say the factor covariance matrix Psi and the residual covariance matrix Theta (e.g. off-diagonal elements can be set to have zero-mean, small-variance priors). See also our technical papers on Bayes implementation in Mplus which are on our website.
I am trying to run a Bayesian CFA model similar to the one shown in Table 15 of Muthén & Asparouhov 2012 (Bayesian structural equation modeling: A more flexible representation of substantive theory. Psychological Methods, 17(3): 313–335); that is, one where residual covariances have inverse Wishart piors. I am basing my code on the code in run15.inp on your website. I have noticed in the code the following line that also assigns inverse Wishart piors with an estimate of 1 to the residual variances: p1-p15~IW(1,21);
Could you explain why this is necessary? It is not explained in the article. I notice that when I leave it out, I get the following error:
THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY. THE PSI MATRIX IS NOT POSITIVE DEFINITE.
You want to give priors for the whole covariance matrix, so not just the off-diagonal covariances but also the diagonal variances. Regarding the settings for the inverse Wishart, we recently posted the following on the variances, implying that the choice of IW(1,21) is not always the best.
Here is one way to think about the IW(Sigma,df) specification, where Sigma is the covariance matrix and df is the degrees of freedom. Denote the number variables of the covariance matrix by p. Our BSEM article appendix and wikipedia points out that df > p+1 makes the mean exist, so a weak prior may have df=p+2. A larger df makes the prior stronger. Furthermore, the mode is
mode = Sigma/(df+p+1).
So say that you want the mode to correspond to a variance of say v. Together with df=p+2, you can then solve for Sigma in IW(Sigma,df) as
Sigma = v*(2p+3).
For instance, p=10 and v=50 gives df=12 and Sigma = 50*23 = 1150, so IW(1150,12).
thanks for the thorough explanation. 3 followup questions: 1. Do you still recommend IW(0,p+2) for the covariances? 2. Is it correct to conclude from your post that if I give priors to any element in the var-covariance matrix I must give priors to all elements? Suppose I have a SEM with 50 observed variables and know that the measurement model of 2 LVs (each having 5 indicators) is problematic so want to use your methods of assigning IW priors to the 90 residual covariances between and 10 variances of their indicators. Do I have to assign IW priors to all 1225 covariances and 50 variances? Or is there a way to do so only for the part of the model that I believe to have problems? 3. Are cross-loadings with 0-mean normal priors required to make this work, or can I give IW priors to the covariance matrix without also giving priors to cross-loadings?
This is a clarification on 3. You need priors for unindentified cross loadings such as when all cross loadings are included. If you are using cross loadings that are identifiable (for example when only some cross loadings are included in the model) you don't need priors.
Thanks for all the guidance. A clarification question: does a smaller DF value for an IW prior mean a stricter (more informative) prior (as with a normal prior's variance) or does it mean a less informative prior?
1. A followup question to your above post about an updated approach to setting IW priors for residual variances.
I am trying a Bayesian CFA model with 27 observed variables (all continuous) and 7 LVs. When I don't estimate residual covariances at all I get a very poor fit. If estimate all possible residual covariances following the example in your Muthén & Asparouhov 2012 Psych Methods paper (resid variances have priors c1-c27~IW(1,29) and resid covariances have prios p1-p351~IW(0,29) ) I get good fit and in addition the loadings for most indicators on almost all LVs improve noticeably. In addition, 18 resid covariances are significant.
Then I try the new recommendation. Given that when I do not add priors the residual variances are in the range .2-.8 with most being around .5, I set the Sigma for resid variance priors to achieve a mode of .5: .5(27*2+3) = 28.5 However I get the following error for any Sigma > 3: THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY. THE PSI MATRIX IS NOT POSITIVE DEFINITE.
THE PROBLEM OCCURRED IN CHAIN 2.
PROBLEM INVOLVING VARIABLES Q28_O AND JINS.
For Sigma = 2 or 3 the results are very similar to Sigma = 1. Can you explain why the error occurs for Sigma > 3?
This did not fit in the above give the size limits of posts:
2. In your paper you write, "An excellent-fitting model is expected to have a posterior predictive p value around .5 and an f statistic difference of zero falling close to the middle of the confidence interval." When I use a Sigma = 1 for the resid variances I get the following fit: Chi-sq diff 95% CI: (-99.122 56.210) p= 0.726
How should I interpret this given that the CI is skewed towards the negative and that p > .5 rather then less than?
2. p = 0.726 is still a good fit. I don't think it is important that it is greater than .5.
Ted Fong posted on Sunday, April 20, 2014 - 9:09 am
Dear Dr. Muthen,
I am evaluating the factor structure of a 9-item scale via specifying 3 Bayes CFA models (one-factor, three-factor, and bifactor model with 1 general and 2 specific factors) using informative priors for the residual covariances. All of the 3 models show a good fit with PPP around .5.
1) My intention is to compare them via information criteria shown in the output. However, the DIC and BIC appear to show conflicting results: 1-factor model: DIC = 21017, BIC = 21344 3-factor model: DIC = 21008, BIC = 21494 bifactor model: DIC = 20714, BIC = 21684
The 1-factor model has the highest DIC but the lowest BIC. The bifactor model, on the other hand, has the lowest DIC but highest BIC. I know that BIC is favored over AIC in mixture modeling. Do you have a preference for using the DIC or BIC in comparing Bayesian CFA models?
2) The Estimated Number of Parameters (pD) is positive in the 1- or 3-factor CFA models but is negative (-248.970) in the bifactor model. Does this negative pD signify a problem for the bifactor model?
1) DIC tends to select over-fitted models (it is very similar to AIC).
2) Usually a large negative pD value signifies a problem. Try to diagnose it with the the traceplots for the parameters. Perhaps some kind of sign switching is happening. You can read section 3 in http://statmodel.com/download/HighDimension.pdf for some ideas.
Ted Fong posted on Sunday, April 27, 2014 - 9:02 am
Dear Dr. Asparouhov,
Thanks for your reply and expert opinions.
Following your advice, I checked the trace plots for the parameters in the bifactor model. Yes, the major loadings on the 2 specific factors showed some kind of sign switching and bimodal posterior distributions with wide 95% CI e.g. (-0.384, 0.877).
I have read section 3.1 of your paper but still am not clear on the cause and proper treatment of such unidentification problem.
1) I read from page 6 of your paper: "the only statistic that is not essentially distorted by the multiple modes is the mode of the posterior". Does this mean using POINT = MODE may help in this problem?
2) I tried constraining these major loadings to be greater than zero using model constraint. However, the model estimation did not terminate normally: UNABLE TO GENERATE PARAMETERS SATISFYING THE CONSTRAINTS. CHECK THE STARTING VALUES. THE PROBLEM OCCURRED IN CHAIN 2.
3) I also tried specifying informative priors e,g, N(0.3, 0.01) for these major loadings. This results in a pD of 42.938 for the model with no apparent sign switching. However, in Ex 5.31 of the UG, informative priors are specified only for cross-loadings but not major loadings. I am not sure adding informative priors is a correct way to tackle the issue.
I would be grateful if you would have any comments.
Dear Bengt, Linda and Tihomir, concerning the calculation of the DIC I stumbled upon the following questions: I observe differences between BIC and DIC in favoring a particular CFA model with approximate MI. The BIC seems to penalize the additional uncertainty reflected by the prior variance of the approximate invariance constraints stronger than the DIC. Is this difference based on the BICs stonger penalization of model complexity in general or is it based on a difference in the likelihood functions or both? Is the Bayesian loglikelihood an aggregation of loglikelihoods obtained from the posterior draws or from the final posterior? Thank you, Daniel.
It is due to BICs stonger penalization of model complexity. If you keep invariance parameters as equal you can expect to see more agreement between BIC and DIC. We use the final posterior for the computation of BIC and DIC.
I wonder if there's a way to request Svalues with standardized estimates under the Bayes estimator? I fit CFA on a small sample and I'd like to first fit the Bayesian CFA and then use these estimates as the plausible values for WLMSV estimator.
Thank you for the prompt reply. Any chance unstandardized estimates can still be used as possible values in the ML model? I believe the latter assumes the values (constraints) are standardized which would affect model specification.
Sorry I was not clear. I am fitting a CFA model for mixed outcomes based on a relatively small sample. Because of the sample size, I first want to model the data via Bayes estimation and use the model parameters (obtained via SVALUES) to reproduce the same model via WLSMV in order to avoid convergence issues.
Now, when I fit the model using WLSMV the SVALUES (at least the loadings) are standardized and can be used to reproduce the same model on e.g. another sample. When I fit the model via Bayesian estimator, resulting SVALUES (loadings) are not standardized and using them to reproduce the same factorial structure leads to nonsensical outcomes. For instance, this is an excerpt from the SVALUES command using Bayesian estimator
f1 BY var1*2.48467; f1 BY var2*2.13034; f1 BY var3*1.45484;
Whenever I impose these constraints on the new model (say, either based on a different sample from the same population or based on the same sample but using a different estimator), Mplus assumes the factor loadings above are standardized, which, of course, results in the model that makes no sense.
Hence, to reiterate, I was trying to figure out whether there is a way to use these unstandardized parameters from the SVALUES output as constraints in another model, either based on another sample or using a different estimator.
I think I know what you mean. Bayes for categorical variable uses the "Theta parameterization" where the continuous latent response variables don't have variances 1, but instead the Theta variances are 1. When you move to WLSMV you probably use the default Delta parameterization where the lrv's have variances 1. If this is what's happening, you want to request Parameterization=Theta in your WLSMV run; then the Bayes unstandardized estimates should work fine.
Bingo! This is precisely what I meant. Thank you so much for clarifying this, Dr. Muthen.
Ted Fong posted on Tuesday, March 24, 2015 - 11:41 pm
Dear Dr. Asparouhov/ Dr. Muthen,
Your recent paper on "BSEM with cross-loadings and residual covariances" recommends the use of DIC rather than BIC for model selection involving informative priors, as BIC over-penalizes BSEM model by counting approximately zero parameters as actual parameters (if my understanding is correct)
I followed your paper and conducted BSEM with residual covariances on three (1-factor, 3-factor, and bifactor) models on a 9-item measure. Since all my three BSEM models include only informative priors (d = 300) for the same 36 residual covariances, would it makes sense to you if I compare the 3 models using also BIC?
I ask because these three BSEM models show highly similar DIC but different BIC. I am not sure if I can compare their BIC when they appear to have the same specifications on informative priors. (the residual variances of the 9 items did vary slightly across the three models...)
In that paper we recommended DIC for situations where BSEM models are compared against SEM models, we did not imply that DIC will be better if one BSEM model is compared to another BSEM model. In fact approximately zero parameters shouldn't really cause damage if one BSEM model is compared to another BSEM model - assuming they are present in both models. I don't really see why DIC and BIC would be that different in the situation you are describing. One way to figure this out is via a simulation study. You should also consider the SEM based inference for the three models as the residual covariance shouldn't really affect the choice between the three factor structures. For more insights I will have to look at the actual results. You can send them to firstname.lastname@example.org
Ted Fong posted on Wednesday, March 25, 2015 - 8:38 pm
Dear Dr. Asparouhov,
Specifying various cross-loading priors for 3-factor and bi-factor models resulted in PPP = .000
All 3 models (N = 556) showed acceptable PPP and equivalent DIC. Since they specified the same informative priors, I guess I could argue that the substantially lower BIC favors the 1-factor model over than other two?
I think you should use BIC results which also agree with PPP. The deviance (DIC-2*Pd) pretty much does not change across the models and it would be hard to justify adding to the complexity of the model. DIC and AIC are well known to have a bias towards more complex models as they do not penalize sufficiently for the increase in the number of parameters.
You should also run more iterations possibly double the number of iterations to check the above results replicate.
Also to be sure that BSEM is not interfering in anyway, you can run the corresponding non-BSEM models where residual covariances that are significant in the BSEM models are set as free parameters while the rest are fixed to zero.
Ted Fong posted on Sunday, March 29, 2015 - 8:26 pm
Dear Dr. Asparouhov,
Yes, I have run all 3 BSEM models using different no. of iterations and they converged rather easily in 20,000 or 40,000 iterations (PSR < 1.05 throughout)
As you suggested, I will use BIC to argue for the 1-factor BSEM model, since the increased model complexity results in higher BIC but not lower DIC.
Though 1/3 of the residual correlations are statistically significant in the 1-factor model, all of them are smaller than 0.17 and probably substantively insignificant. With reference to Section 2.5 in your paper, I intend to attribute the model misfit to minor residual correlations and treat the 1-factor model as a approximate model to the data.
Deeply appreciate your time and invaluable insights on the BSEM results.
I am trying to estimate a Bayesian CFA as shown in Table 15 in the BSEM paper (Muthén & Asparouhov, 2012, Psych Methods). However, when I include weakly-informative priors for cross-loadings and residual correlations I obtain the following error message:
THE MODEL ESTIMATION DID NOT TERMINATE NORMALLY. THE PSI MATRIX IS NOT POSITIVE DEFINITE. THE PROBLEM OCCURRED IN CHAIN 3. PROBLEM INVOLVING VARIABLES A_P1ASUP AND INT.
How can I investigate what's causing this problem and are there ways to remedy this problem?
Dear Prof Muthén, I have three questions regarding the evaluation of informative priors.
1. I have a CFA model of a well known six items scale. Basically, there are six items loading on a single latent factor (simple congeneric model) I derived the average loading for each of the six items from 8 available studies reporting the same model. Then now I have six informative priors for replicating this model in a new dataset. These priors are on a standardized scale (i.e., all previous studies reported completely standardized loadings). It is correct to use the "Standardize" procedure in order to inform Mplus on which scale evaluate these priors? 3. Can I derive informative information about the variance of the above priors by computing the average variance of the six loadings across previous studies? 2. There is a way to conduct a "sensitivity" analysis on informative priors? I mean, there is a way to evaluate the gain associated with removing an informative prior? I thank you in advance for your attention, and apologise for the naivety of these questions. Lotti
2. A sensitivity analysis is done in the paper on our website:
Muthén, B. & Asparouhov, T. (2012). Bayesian SEM: A more flexible representation of substantive theory. Psychological Methods, 17, 313-335. Click ""download paper"" below for the latest version of October 21, 2011. Download the 2nd version dated April 14, 2011. Click here to view the seven web tables referred to in the paper and here to view Mplus inputs, data, and outputs used in this version of paper. Download the 1st version dated September 29, 2010 containing a MIMIC section and more tables, and the corresponding Mplus inputs, data, and outputs here. The seven web tables correspond to tables 8, 10, 17, 18, 19, 20, and 21 of the first version.
Note also my intro Bayes paper:
Muthén, B. (2010). Bayesian analysis in Mplus: A brief introduction. Technical Report. Version 3. Click here to view Mplus inputs, data, and outputs used in this paper.
I apologize in advance for the very basic question:
I am interested in applying some of the methods described in the recent Journal of Management article (Asparouhov, Muthén, & Morin, 2015).
In our initial run, I don't see the BIC or DIC reported in the output. I do see that formulas 6 through 9 in the Asparouhov et al. article do show how they are calculated. However, I am not even sure I know where in the output I find all of the values to plug into the formulas.
My questions are (a) is there a way to get the BIC and DIC to print in the output or (b) is there an applied example/annotated output that I could reference that would provide some guidance on computing these values for myself?
Fyi, I am pasting below what is printed in the model fit section of our output:
MODEL FIT INFORMATION
Number of Free Parameters 160
Bayesian Posterior Predictive Checking using Chi-Square
95% Confidence Interval for the Difference Between the Observed and the Replicated Chi-Square Values
Hi Bengt and Linda - Thank you. For the benefit of others, I am pasting below Linda's response after having viewed my output:
"BIC and DIC are not available with categorical outcomes using the Bayes estimator. It is not possible to compute these by hand." (Linda K. Muthen, sent Mon 8/17/2015 6:23 PM).
Along these lines then, I do have a follow up question: We were only working with the Bayes estimator at this phase because next steps in the analysis involved applying the BSEM Measurement Invariance approach described in Web Notes No. 17 (Muthén & Asparouhov, 2013).
We would have a 2- or 3-factor model with multiple-groups, where indicators are mostly binary and others are counts (which we have taken a natural log of and treat as continuous). My question is, do you foresee a problem applying the BSEM multiple-group approach given that many of our indicators are categorical (or that we have a mixture of categorical and continuous)? I ask because I wasn't expecting the limitation of using categorical DVs with Bayes that I learned about in Linda's response above--and I want to see if there are additional limitations that may apply to our planned next steps. The Fox (2010) example you provide indicates the use of binary indicators, so I assume there should be no problem.
Any caution you may have regarding this plan will be greatly appreciated.
I am trying to run an ordinal bayesian CFA model on a 5 item measure. I would like to set the residual covariances for the items to near zero. If I understand the recommendations correctly, I want to explore IW(0,11) priors on the covariances but also need to place priors on the residual variances as well, such as IW(1,11). The problem I am running into is with the label. I can label the covariance parameters in the WITH statement, e.g., u1 WITH u2 (a6). However, when I want to label the residual variances using u1-u5 (a1-a5), Mplus tells me I cannot run this line under =bayes. The computer is expecting another estimator such as WLSMV. How do I assign a label to the residual variances to allow for a prior when the observed variables are categorical?
I had speculated it was the cause of my problem since with other categorical estimators the residual variances are a function of the loadings but was not entirely confident it extended to the bayesian estimator.
I am trying to regress five items onto a single latent variable using bayesian estimation. I have placed near zero constrains on the residual covariances using IW(0,34) based upon five items and sample size. This model does not converge including when increasing the chains. When I remove the near zero covariances the models converges (looks decent too; ppp = .270). Mplus is flagging the PSR for one of the residual covariances and looking at the covariances it looks like there are one or more significant and moderate residual correlations that might be creating my problem. I am trying to free up the one or more problematic covariances but am having trouble finding much documentation on the strategy. It looks like a N(0, .001) is placed on the residual covariance but I am not sure about that. Please help. Thanks!
I recommend looking at the strategies presented in the paper on our website:
Asparouhov, T., Muthén, B. & Morin, A. J. S. (2015). Bayesian structural equation modeling with cross-loadings and residual covariances: Comments on Stromeyer et al. Journal of Management, 41, 1561-1577.
Thanks for the reference. It provided much needed procedural structure for me. Two quick follow-up question. In Muthen & Asparouhov (2012) it looks like the 3rd method for placing near zero priors on the residual covariances consists of placing a normal prior on the covariance, N(0, .001), and an inverse-gamma on the residual variances and the MCMC chains ran with a random walk. Is that understanding correct? If so, would it suggest that a normal prior should be placed on the covariances of the latent factors rather than an inverse-wishart? Thanks for the help!
Martin - it makes no sense to me that you want to include residual covariance. If PPP=0.27 you should stop there and not add any more parameters. I don't see any reasons to switch to non-conjugate priors such as the normal. Our general recommendation is to start with IW(0,500) say and slowly decrease the degrees of freedom until you hit convergence problems or/and very slow convergence or PPP stops improving (but note there is no room for improvement if PPP=0.27 with IW(0,500))