Raphael Royaute
2012-Jun-04 16:21 UTC
[R] Negative variance with lavaan in a multigroup analysis.
Hi list members, I saw a couple lavaan posts here so I think I?m sending this to the correct list. I am trying to run a multigroup analysis with lavaan in order to compare behavioural correlations across two populations. I?m following the method suggested in the paper by Dingemanse et al. (2010) in Behavioural Ecology. In one of the groups, lavaan returns negative variance for one path and I?m unable to obtain the corresponding R-square. As far as I know, this is not due to measurement error so I?m wondering what else could be causing this. Since the behavioral variables were standardized at the population level prior to SEM analysis, lavaan should return 1 for the variance and all paths coefficients should vary between 0 and 1, right? Is there anything wrong in my code that may be causing this? Thanks a lot for your help! Raphael Royaute PhD candidate Dept Natural Resource Sciences McGill University, Macdonald campus Below is my code and output (my apologies, this is a pretty lengthy output): Riskmodel2_cfa <- '# Latent variable ????? ????? SySt =~ Activity+Aggression+Voracity # Residuals ??????? Boldness~~Boldness' fit.riskmodel2_multi_Ad_cfa <- cfa(Riskmodel2_cfa, data=Ad_scale, std.lv=T,std.ov=T, ???????????????????????????????? se= "boot",test="bootstrap", ???????????????????????????????? bootstrap=5000L,group="Site") summary(fit.riskmodel2_multi_Ad_cfa,standardized=T, rsquare=T) lavaan (0.4-14) converged normally after 50 iterations ? Number of observations per group ? 1???????????????????????????????????????????????? 56 ? 0????????????????????? ???????????????????????????41 ? Estimator???????????????????????????????????????? ML ? Minimum Function Chi-square??????????????????? 6.171 ? Degrees of freedom???????????????????????????????? 6 ? P-value??????????????????????????????????????? 0.404 ? P-value (Bollen-Stine Bootstrap)?????????????? 0.566 Chi-square for each group: ? 1????????????????????????????????????????????? 4.832 ? 0????????????????????????????????????????????? 1.339 Parameter estimates: ? Information?????????????????????????????? ??Observed ? Standard Errors??????????????????????????? Bootstrap ? Number of requested bootstrap draws???????????? 5000 ? Number of successful bootstrap draws??????????? 3423 Group 1 [1]: ?????????????????? Estimate? Std.err? Z-value? P(>|z|)?? Std.lv? Std.all Latent variables: ? SySt =~ ??? Activity????????? 0.295??? 0.193??? 1.532??? 0.126??? 0.295??? 0.298 ??? Aggression??????? 0.962??? 7.533??? 0.128??? 0.898??? 0.962??? 0.971 ??? Voracity????????? 0.481??? 1.223??? 0.393??? 0.694??? 0.481??? 0.485 Intercepts: ??? Activity????????? 0.000??? 0.132??? 0.000??? 1.000??? 0.000??? 0.000 ??? Aggression??????? 0.000??? 0.131??? 0.000??? 1.000??? 0.000??? 0.000 ??? Voracity???????? -0.000??? 0.133?? -0.000??? 1.000?? -0.000?? -0.000 ??? Boldness????????? 0.000??? 0.130??? 0.000??? 1.000??? 0.000??? 0.000 ??? SySt????????????? 0.000?????????????????????????????? 0.000??? 0.000 Variances: ??? Boldness????????? 0.982??? 0.192????????????????????? 0.982??? 1.000 ??? Activity????????? 0.895??? 0.194????????????? ????????0.895??? 0.911 ??? Aggression??????? 0.056? 291.974????????????????????? 0.056??? 0.057 ??? Voracity????????? 0.751?? 31.367????????????????????? 0.751??? 0.765 ??? SySt????????????? 1.000?????????????????????????????? 1.000??? 1.000 Group 2 [0]: ?????????????????? Estimate? Std.err? Z-value? P(>|z|)?? Std.lv? Std.all Latent variables: ? SySt =~ ??? Activity????????? 1.599?? 11.281??? 0.142??? 0.887??? 1.599??? 1.619 ??? Aggression??????? 0.162??? 0.219??? 0.740??? 0.459??? 0.162??? 0.164 ??? Voracity????????? 0.260??? 0.238??? 1.094??? 0.274??? 0.260??? 0.263 Intercepts: ??? Activity????????? 0.000??? 0.155??? 0.000??? 1.000??? 0.000??? 0.000 ??? Aggression?????? -0.000??? 0.154?? -0.000??? 1.000?? -0.000?? -0.000 ??? Voracity????????? 0.000??? 0.156??? 0.000??? 1.000??? 0.000??? 0.000 ??? Boldness????????? 0.000??? 0.156??? 0.000??? 1.000??? 0.000??? 0.000 ??? SySt????????????? 0.000?????????????????????????????? 0.000??? 0.000 Variances: ??? Boldness????????? 0.976??? 0.156???????????????????? ?0.976??? 1.000 ??? Activity???????? -1.580? 459.764???????????????????? -1.580?? -1.620 ??? Aggression??????? 0.949??? 0.197????????????????????? 0.949??? 0.973 ??? Voracity????????? 0.908??? 0.248????????????????????? 0.908??? 0.931 ??? SySt???????????? ?1.000?????????????????????????????? 1.000??? 1.000 R-Square Group 1: ??? Activity????????? 0.089 ??? Aggression??????? 0.943 ??? Voracity????????? 0.235 R-Square Group 0: ??? Activity???????????? NA ??? Aggression??????? 0.027 ??? Voracity????????? 0.069
Seemingly Similar Threads
- SEM multigroup modeling
- Question about measurment invariance in a multigroup SEM
- Hotelling T2 test extension for multigroup data
- New package: `lavaan' for latent variable analysis (including structural equation modeling)
- New package: `lavaan' for latent variable analysis (including structural equation modeling)