Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Anders Alexandersson <andersalex@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Odd SEM Results |
Date | Mon, 5 Aug 2013 11:13:48 -0400 |
Hi Joe, only the first model from the SEM builder specifies the options "latent(Intercept Slope ) nocapslatent" which, I guess, might be why this model has chi2(45) instead of chi2(43) and no output for _cons in the structural model. What happens if you instead use the default? Anders Alexandersson andersalex@gmail.com On Sat, Aug 3, 2013 at 12:38 PM, Joseph Trubisz <jtrubisz@mac.com> wrote: > Greetings... > > I probably am just missing something, but I don't know what. > I'm attempting to use sembuilder to create the diagram from Acock's SEM book, specifically the example > as shown on p.188. > > If I use sembuilder, it generates the following output: > > . sem (Intercept@1 -> bmi01) (Intercept@1 -> bmi02) (Intercept@1 -> bmi03) (Intercept@1 -> bmi05) (Interc >> ept@1 -> bmi06) (Intercept@1 -> bmi07) (Intercept@1 -> bmi08) (Intercept@1 -> bmi09) (Slope@0 -> bmi01) >> (Slope@1 -> bmi02) (Slope@2 -> bmi03) (Slope@4 -> bmi05) (Slope@5 -> bmi06) (Slope@6 -> bmi07) (Slope@ >> 7 -> bmi08) (Slope@8 -> bmi09) (_cons -> Intercept) (_cons -> Slope) (male -> Intercept) (male -> Slope >> ) (wgtc -> Intercept) (wgtc -> Slope) if bmi01!=.|bmi02!=.|bmi03!=.|bmi05!=.|bmi06!=.|bmi07!=.|bmi08!=. >> |bmi09!=., method(mlmv) latent(Intercept Slope ) var( e.Intercept*e.Slope) nocapslatent noconstant > note: Missing values found in observed exogenous variables. Using the noxconditional behavior. Specify > the forcexconditional option to override this behavior. > Endogenous variables > > Measurement: bmi01 bmi02 bmi03 bmi05 bmi06 bmi07 bmi08 bmi09 > Latent: Intercept Slope > > Exogenous variables > > Observed: male wgtc > > Fitting saturated model: > > Iteration 0: log likelihood = -30162.223 > Iteration 1: log likelihood = -29297.714 > Iteration 2: log likelihood = -28707.587 > Iteration 3: log likelihood = -28564.929 > Iteration 4: log likelihood = -28557.353 > Iteration 5: log likelihood = -28557.204 > Iteration 6: log likelihood = -28557.204 > > Fitting baseline model: > > Iteration 0: log likelihood = -36523.419 > Iteration 1: log likelihood = -36520.845 > Iteration 2: log likelihood = -36520.836 > Iteration 3: log likelihood = -36520.836 > > Fitting target model: > > Iteration 0: log likelihood = -52919.48 (not concave) > Iteration 1: log likelihood = -52675.161 (not concave) > Iteration 2: log likelihood = -52171.219 (not concave) > Iteration 3: log likelihood = -49397.835 (not concave) > Iteration 4: log likelihood = -42220.623 (not concave) > Iteration 5: log likelihood = -39274.796 > Iteration 6: log likelihood = -38652.54 > Iteration 7: log likelihood = -34772.666 > Iteration 8: log likelihood = -32169.128 > Iteration 9: log likelihood = -31367.639 > Iteration 10: log likelihood = -30934.922 > Iteration 11: log likelihood = -30910.018 > Iteration 12: log likelihood = -30909.236 > Iteration 13: log likelihood = -30909.234 > > Structural equation model Number of obs = 1581 > Estimation method = mlmv > Log likelihood = -30909.234 > > ( 1) [bmi01]Intercept = 1 > ( 2) [bmi02]Intercept = 1 > ( 3) [bmi02]Slope = 1 > ( 4) [bmi03]Intercept = 1 > ( 5) [bmi03]Slope = 2 > ( 6) [bmi05]Intercept = 1 > ( 7) [bmi05]Slope = 4 > ( 8) [bmi06]Intercept = 1 > ( 9) [bmi06]Slope = 5 > (10) [bmi07]Intercept = 1 > (11) [bmi07]Slope = 6 > (12) [bmi08]Intercept = 1 > (13) [bmi08]Slope = 7 > (14) [bmi09]Intercept = 1 > (15) [bmi09]Slope = 8 > (16) [bmi01]_cons = 0 > (17) [bmi02]_cons = 0 > (18) [bmi03]_cons = 0 > (19) [bmi05]_cons = 0 > (20) [bmi06]_cons = 0 > (21) [bmi07]_cons = 0 > (22) [bmi08]_cons = 0 > (23) [bmi09]_cons = 0 > -------------------------------------------------------------------------------- > | OIM > | Coef. Std. Err. z P>|z| [95% Conf. Interval] > ---------------+---------------------------------------------------------------- > Structural | > Intercept <- | > male | 26.90551 .6496371 41.42 0.000 25.63225 28.17878 > wgtc | 6.996785 .6003745 11.65 0.000 5.820072 8.173497 > -------------+---------------------------------------------------------------- > Slope <- | > male | .3657208 .02104 17.38 0.000 .3244831 .4069584 > wgtc | .0889063 .0194718 4.57 0.000 .0507423 .1270703 > ---------------+---------------------------------------------------------------- > Measurement | > bmi01 <- | > Intercept | 1 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi02 <- | > Intercept | 1 (constrained) > Slope | 1 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi03 <- | > Intercept | 1 (constrained) > Slope | 2 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi05 <- | > Intercept | 1 (constrained) > Slope | 4 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi06 <- | > Intercept | 1 (constrained) > Slope | 5 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi07 <- | > Intercept | 1 (constrained) > Slope | 6 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi08 <- | > Intercept | 1 (constrained) > Slope | 7 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi09 <- | > Intercept | 1 (constrained) > Slope | 8 (constrained) > _cons | 0 (constrained) > ---------------+---------------------------------------------------------------- > Mean | > male | .4990512 .0125749 39.69 0.000 .474405 .5236975 > wgtc | -.0001655 .0192488 -0.01 0.993 -.0378925 .0375614 > ---------------+---------------------------------------------------------------- > Variance | > e.bmi01 | 2.618815 .2046736 2.246876 3.052323 > e.bmi02 | 4.086149 .2175673 3.681222 4.535619 > e.bmi03 | 4.674361 .2320231 4.241024 5.151974 > e.bmi05 | 5.778033 .2604252 5.289505 6.311681 > e.bmi06 | 8.181968 .3511234 7.521926 8.899928 > e.bmi07 | 3.794672 .1906747 3.438769 4.187409 > e.bmi08 | 2.92201 .1689406 2.608965 3.272618 > e.bmi09 | 3.308288 .2088301 2.923295 3.743984 > e.Intercept | 324.2532 11.61219 302.2741 347.8304 > e.Slope | .2448578 .0117764 .2228311 .269062 > male | .2499991 .0088918 .2331651 .2680484 > wgtc | .5851282 .0208269 .5456996 .6274057 > ---------------+---------------------------------------------------------------- > Covariance | > e.Intercept | > e.Slope | 4.109434 .280162 14.67 0.000 3.560327 4.658542 > -------------+---------------------------------------------------------------- > male | > wgtc | -.0751429 .0098082 -7.66 0.000 -.0943666 -.0559193 > -------------------------------------------------------------------------------- > LR test of model vs. saturated: chi2(45) = 4704.06, Prob > chi2 = 0.0000 > > > However, the output is nothing like what's in the book. However, if I type in > exactly what's in the book (p.188), I get the correct results as shown below: > > . sem (Intercept@1 Slope@0->bmi01) (Intercept@1 Slope@1->bmi02) (Intercept@1 Slope@2->bmi03) (Intercept@1 >> Slope@4->bmi05)(Intercept@1 Slope@5->bmi06)(Intercept@1 Slope@6->bmi07)(Intercept@1 Slope@7->bmi08)(In >> tercept@1 Slope@8->bmi09) (Intercept Slope<-male wgtc _cons) if bmi01!=.|bmi02!=.|bmi03!=.|bmi05!=.|bmi >> 06!=.|bmi07!=.|bmi08!=.|bmi09!=.,var(e.Intercept*e.Slope) method(mlmv) noconstant > note: Missing values found in observed exogenous variables. Using the noxconditional behavior. Specify > the forcexconditional option to override this behavior. > Endogenous variables > > Measurement: bmi01 bmi02 bmi03 bmi05 bmi06 bmi07 bmi08 bmi09 > Latent: Intercept Slope > > Exogenous variables > > Observed: male wgtc > > Fitting saturated model: > > Iteration 0: log likelihood = -30162.223 > Iteration 1: log likelihood = -29297.714 > Iteration 2: log likelihood = -28707.587 > Iteration 3: log likelihood = -28564.929 > Iteration 4: log likelihood = -28557.353 > Iteration 5: log likelihood = -28557.204 > Iteration 6: log likelihood = -28557.204 > > Fitting baseline model: > > Iteration 0: log likelihood = -36523.419 > Iteration 1: log likelihood = -36520.845 > Iteration 2: log likelihood = -36520.836 > Iteration 3: log likelihood = -36520.836 > > Fitting target model: > > Iteration 0: log likelihood = -52919.48 (not concave) > Iteration 1: log likelihood = -52663.873 (not concave) > Iteration 2: log likelihood = -52499.164 (not concave) > Iteration 3: log likelihood = -52371.927 (not concave) > Iteration 4: log likelihood = -46362.021 (not concave) > Iteration 5: log likelihood = -34630.285 (not concave) > Iteration 6: log likelihood = -34303.836 (not concave) > Iteration 7: log likelihood = -29724.362 > Iteration 8: log likelihood = -29095.8 > Iteration 9: log likelihood = -28787.969 > Iteration 10: log likelihood = -28750.647 > Iteration 11: log likelihood = -28750.02 > Iteration 12: log likelihood = -28750.019 > > Structural equation model Number of obs = 1581 > Estimation method = mlmv > Log likelihood = -28750.019 > > ( 1) [bmi01]Intercept = 1 > ( 2) [bmi02]Intercept = 1 > ( 3) [bmi02]Slope = 1 > ( 4) [bmi03]Intercept = 1 > ( 5) [bmi03]Slope = 2 > ( 6) [bmi05]Intercept = 1 > ( 7) [bmi05]Slope = 4 > ( 8) [bmi06]Intercept = 1 > ( 9) [bmi06]Slope = 5 > (10) [bmi07]Intercept = 1 > (11) [bmi07]Slope = 6 > (12) [bmi08]Intercept = 1 > (13) [bmi08]Slope = 7 > (14) [bmi09]Intercept = 1 > (15) [bmi09]Slope = 8 > (16) [bmi01]_cons = 0 > (17) [bmi02]_cons = 0 > (18) [bmi03]_cons = 0 > (19) [bmi05]_cons = 0 > (20) [bmi06]_cons = 0 > (21) [bmi07]_cons = 0 > (22) [bmi08]_cons = 0 > (23) [bmi09]_cons = 0 > -------------------------------------------------------------------------------- > | OIM > | Coef. Std. Err. z P>|z| [95% Conf. Interval] > ---------------+---------------------------------------------------------------- > Structural | > Intercept <- | > male | 1.555545 .2436739 6.38 0.000 1.077953 2.033137 > wgtc | 3.759441 .160021 23.49 0.000 3.445806 4.073077 > _cons | 24.85781 .170538 145.76 0.000 24.52356 25.19206 > -------------+---------------------------------------------------------------- > Slope <- | > male | .0173321 .0271012 0.64 0.522 -.0357853 .0704495 > wgtc | .0459197 .0178505 2.57 0.010 .0109333 .0809062 > _cons | .3430045 .0189564 18.09 0.000 .3058506 .3801584 > ---------------+---------------------------------------------------------------- > Measurement | > bmi01 <- | > Intercept | 1 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi02 <- | > Intercept | 1 (constrained) > Slope | 1 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi03 <- | > Intercept | 1 (constrained) > Slope | 2 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi05 <- | > Intercept | 1 (constrained) > Slope | 4 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi06 <- | > Intercept | 1 (constrained) > Slope | 5 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi07 <- | > Intercept | 1 (constrained) > Slope | 6 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi08 <- | > Intercept | 1 (constrained) > Slope | 7 (constrained) > _cons | 0 (constrained) > -------------+---------------------------------------------------------------- > bmi09 <- | > Intercept | 1 (constrained) > Slope | 8 (constrained) > _cons | 0 (constrained) > ---------------+---------------------------------------------------------------- > Mean | > male | .4990512 .0125749 39.69 0.000 .474405 .5236975 > wgtc | -.0009276 .0192434 -0.05 0.962 -.0386439 .0367888 > ---------------+---------------------------------------------------------------- > Variance | > e.bmi01 | 2.443884 .191981 2.095144 2.850673 > e.bmi02 | 4.1472 .2157233 3.745229 4.592315 > e.bmi03 | 4.772852 .2325326 4.33818 5.251077 > e.bmi05 | 5.789807 .2596509 5.302625 6.321749 > e.bmi06 | 8.228898 .3520222 7.56708 8.948599 > e.bmi07 | 3.810727 .1909167 3.454322 4.203904 > e.bmi08 | 2.922193 .1687984 2.609396 3.272487 > e.bmi09 | 3.298484 .2089123 2.913418 3.734444 > e.Intercept | 20.5145 .8043478 18.99706 22.15315 > e.Slope | .189059 .0097265 .170925 .2091168 > male | .2499991 .0088918 .2331651 .2680484 > wgtc | .5849257 .0208131 .5455228 .6271748 > ---------------+---------------------------------------------------------------- > Covariance | > e.Intercept | > e.Slope | -.0272943 .0635517 -0.43 0.668 -.1518533 .0972647 > -------------+---------------------------------------------------------------- > male | > wgtc | -.0747626 .0098037 -7.63 0.000 -.0939775 -.0555478 > -------------------------------------------------------------------------------- > LR test of model vs. saturated: chi2(43) = 385.63, Prob > chi2 = 0.0000 > > Problem: I look at the command not working and comparing it to the command that does > work and I don't see the difference. > > Can anyone point out to me where I might be going wrong? * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/