{"id":331,"date":"2015-10-09T11:04:59","date_gmt":"2015-10-09T16:04:59","guid":{"rendered":"http:\/\/justinwiegand.com\/blog\/?p=331"},"modified":"2026-03-10T22:31:43","modified_gmt":"2026-03-11T05:31:43","slug":"bayesian-sem-bsem","status":"publish","type":"post","link":"https:\/\/justinwiegand.com\/blog\/?p=331","title":{"rendered":"Bayesian SEM (BSEM) Application and Example"},"content":{"rendered":"<p>Sounds good, right?<\/p>\n<p>Bayesian priors allow cross-loadings and residual covariances of SEM&#8217;s to vary a small degree (i.e., replace exact zeros with approximate zeros from informative, small-variance priors) and be evaluated (see\u00a0Asparouhov, Muth\u00e9n, &amp; Morin, 2015;\u00a0Muth\u00e9n, &amp; Asparouhov 2012). \u00a0The researcher can thereby discover whether 0 cross-loadings likely exist in the &#8220;true&#8221; population model, given their data, and refine their model accordingly.<\/p>\n<p>I recently had the opportunity to apply this technique to a bi-factor model for a new scale that had previously only been subjected to\u00a0a traditional CFA. \u00a0The model had strong theoretical support, but fit indices and some loadings were not supportive of the general factor as theorized. \u00a0These conditions provide a\u00a0perfect opportunity to use\u00a0Bayesian CFA (BCFA) to refine the model\u00a0for cross-validation.<\/p>\n<p>MPlus 7 was used to specify and test a model where cross-loadings were assigned\u00a0normally distributed priors with\u00a00 means and variances of .01. \u00a0The technique\u00a0is not difficult for those familiar with CFA in MPlus. \u00a0Working from a typical CFA, the researcher need only:<\/p>\n<ul>\n<li>Specify &#8220;Bayes&#8221; as your estimator (shown with option recommendations):<\/li>\n<\/ul>\n<pre> ANALYSIS: ESTIMATOR = BAYES; !Uses two independent MCMC chains\r\n   PROCESSORS = 2; !To speed up computations if you have 2 processors\r\n   FBITERATIONS=15000; !Minimum number of Markov Chain iterations<\/pre>\n<ul>\n<li>Include all cross-loadings for a factor below the actual loadings (in our case, the specific factors in a bi-factor model).\n<ul>\n<li>Thus for a data set with 10 items (y1-y10), and two factors (f1 and f2) with loadings y1-y3 and y4-y10 respectively, go from:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre style=\"padding-left: 60px;\">f1 BY y1-y3;\r\nf2 BY y4-y10;\r\n\r\nto\r\n\r\nf1 BY y1-y3\r\n   y4-y10; !Cross-loadings\r\nf2 BY y4-y10\r\n   y1-y3;  !Cross-loadings<\/pre>\n<ul>\n<li>Next, assign labels to the\u00a0cross-loadings so a\u00a0Bayesian prior can be specified for each. \u00a0To do so, expand the syntax with cross-loadings as follows (cross-loadings can be labeled however desired&#8211;I am using &#8220;xlam&#8221; to refer to lamda&#8217;s [loadings] of the cross-loadings [&#8220;x&#8221; for cross]):<\/li>\n<\/ul>\n<pre style=\"padding-left: 60px;\">f1 BY y1-y3\r\n   y4-y10 (f1xlam1-f1xlam7); !Cross-loadings (with assigned labels)\r\nf2 BY y4-y10\r\n   y1-y3(f2xlam1-f2xlam3); !Cross-loadings (with assigned labels)<\/pre>\n<ul>\n<li>Finally,\u00a0model priors are specified by defining \u00a0all the cross-loadings&#8217; distribution, mean, and variance. \u00a0A statement is simply added at the end of the &#8220;Model&#8221; command as follows (for cross-loading priors normally distributed with mean 0 and variances\u00a0of 0.01):<\/li>\n<\/ul>\n<pre style=\"padding-left: 60px;\">MODEL PRIORS:\r\n   f1xlam1-f2xlam3~N(0,0.01); !You can list across factors if ordered<\/pre>\n<p>Naturally, identification and metric setting needs to be addressed\u00a0first (for example, MPlus sets the first loading of a factor to one by default, but you may want to free that and instead set the variance of each factor to 1 instead). \u00a0Yet, hopefully this illustrates\u00a0the ease at which cross-loadings can be assigned Bayesian priors. \u00a0For those interested in assigning\u00a0residual covariances prior distributions the concept is very similar. \u00a0A full example is given in the Asparouhov, Muth\u00e9n, and Morin (2015) article.<\/p>\n<p>Now for the beauty (i.e., application) of BCFA. \u00a0Cross-loadings were assigned a normal prior distribution with mean 0 and variance of 0.01.\u00a0 Were the actual\u00a0loadings 0 given our data? \u00a0The prior and posterior distributions for each loading can be viewed\u00a0to verify this (choose\u00a0&#8220;Plot&#8221; &gt; &#8220;View Plots&#8221; in MPlus) or the confidence intervals for the cross-loadings can be examined in the MPlus output. \u00a0Below\u00a0is an example of a cross-loading for an item I analyzed:<\/p>\n<p>First, examine the prior distribution (made up of 15,000 iterations):<br \/>\n<embed src=\"http:\/\/justinwiegand.com\/blog\/wp-content\/uploads\/2015\/10\/bcfa2prior.pdf\" style=\" height:480px; width:100%;\"><\/embed><a href=\"http:\/\/justinwiegand.com\/blog\/wp-content\/uploads\/2015\/10\/bcfa2prior.pdf\">bcfa2prior<\/a><\/p>\n<p>This looks right, the mean is essentially 0 and variance (Std Dev squared) 0.01 as specified.<\/p>\n<p>Now, did the distribution change given our data? \u00a0Check the posterior distribution to find out (or the confidence intervals for the cross-loadings in the MPlus output):<\/p>\n<p><embed src=\"http:\/\/justinwiegand.com\/blog\/wp-content\/uploads\/2015\/10\/bcfa2post.pdf\" style=\" height:480px; width:100%;\"><\/embed><a href=\"http:\/\/justinwiegand.com\/blog\/wp-content\/uploads\/2015\/10\/bcfa2post.pdf\">bcfa2post<\/a><\/p>\n<p>It appears the distribution\u00a0did change. \u00a0Given our data, the posterior distribution does not include 0 (for a 95% confidence interval). \u00a0This suggests that the specific\u00a0cross-loading should be freed.<\/p>\n<p>This simple illustration is just one way BCFA (and BSEM) adds value for scale and model development. \u00a0I refer you to the linked articles for more. \u00a0Let me know if you&#8217;ve had a chance to apply the technique and what you learned.<\/p>\n<p><strong>References<\/strong><\/p>\n<div id=\"zotpress-202e7163603f7926ec178b9bd7142c7c\" class=\"zp-Zotpress zp-Zotpress-Bib wp-block-group\">\n\n\t\t<span class=\"ZP_API_USER_ID ZP_ATTR\">1559346<\/span>\n\t\t<span class=\"ZP_ITEM_KEY ZP_ATTR\">{:IU7X3CWB},{:N2WSKQJC}<\/span>\n\t\t<span class=\"ZP_COLLECTION_ID ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_TAG_ID ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_AUTHOR ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_YEAR ZP_ATTR\"><\/span>\n        <span class=\"ZP_ITEMTYPE ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_INCLUSIVE ZP_ATTR\">1<\/span>\n\t\t<span class=\"ZP_STYLE ZP_ATTR\">apa<\/span>\n\t\t<span class=\"ZP_LIMIT ZP_ATTR\">50<\/span>\n\t\t<span class=\"ZP_SORTBY ZP_ATTR\">creator<\/span>\n\t\t<span class=\"ZP_ORDER ZP_ATTR\">asc<\/span>\n\t\t<span class=\"ZP_TITLE ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_SHOWIMAGE ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_SHOWTAGS ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_DOWNLOADABLE ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_NOTES ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_ABSTRACT ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_CITEABLE ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_TARGET ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_URLWRAP ZP_ATTR\"><\/span>\n\t\t<span class=\"ZP_FORCENUM ZP_ATTR\"><\/span>\n        <span class=\"ZP_HIGHLIGHT ZP_ATTR\"><\/span>\n        <span class=\"ZP_POSTID ZP_ATTR\">331<\/span>\n\t\t<span class=\"ZOTPRESS_PLUGIN_URL ZP_ATTR\">https:\/\/justinwiegand.com\/blog\/wp-content\/plugins\/zotpress\/<\/span>\n\n\t\t<div class=\"zp-List loading\">\n\t\t\t<div class=\"zp-SEO-Content\">\n\n\t\t\t<\/div><!-- .zp-zp-SEO-Content -->\n\t\t<\/div><!-- .zp-List -->\n\t<\/div><!--.zp-Zotpress-->\n\n\n","protected":false},"excerpt":{"rendered":"<p>Sounds good, right? Bayesian priors allow cross-loadings and residual covariances of SEM&#8217;s to vary a small degree (i.e., replace exact zeros with approximate zeros from informative, small-variance priors) and be evaluated (see\u00a0Asparouhov, Muth\u00e9n, &amp; Morin, 2015;\u00a0Muth\u00e9n, &amp; Asparouhov 2012). \u00a0The researcher can thereby discover whether 0 cross-loadings likely exist in&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":335,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12],"tags":[77,90,89,91,10,86],"class_list":["post-331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sem","tag-bayesian","tag-bcfa","tag-bsem","tag-cfa","tag-mplus","tag-sem"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/justinwiegand.com\/blog\/wp-content\/uploads\/2015\/10\/posterior-dist.jpg?fit=1614%2C960&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p51adQ-5l","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=331"}],"version-history":[{"count":19,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/331\/revisions"}],"predecessor-version":[{"id":894,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/331\/revisions\/894"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/335"}],"wp:attachment":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}