Moderation: error WARNING: some observed variances are a factor 1000 times larger than others

60 views
Skip to first unread message

Carolina Rojas Cordova

unread,
Jul 3, 2019, 4:08:37 PM7/3/19
to lavaan

Hello,

I am trying to run a moderation model, where X=INNSUPP; M=lnTam; and Y = lnTam.
Initially, the script run without problem. However, when I opened R again  and I tried to run the same code, I get the following message:

lavaan WARNING: some observed variances are (at least) a factor 1000 times larger than others; use varTable(fit) to investigatelavaan WARNING: syntax contains parameters involving exogenous covariates; switching to fixed.x = FALSE

The code is
# CENTRANDO LOS DATOS
SME <- SME %>% mutate_at(vars(lnTam, INNSUPP, MAMB), funs(c=scale))

# create interaction term between centered X (socst) and W (math)
SME <- SME %>% mutate(INNSUPP_x_lnTam = INNSUPP_c * lnTam_c)

# parameters
moderation_model <- '
  # regressions
  MAMB ~ b1*INNSUPP_c 
  MAMB ~ b2*lnTam_c 
  MAMB ~ b3*INNSUPP_x_lnTam 
  
  # define mean parameter label for centered math for use in simple slopes
  lnTam_c ~ lnTam.mean*1
  
  # define variance parameter label for centered math for use in simple slopes
  lnTam_c ~~ lnTam.var*lnTam_c
  
  # simple slopes for condition effect
  SD.below := b1 + b3*(lnTam.mean - sqrt(lnTam.var))
  mean := b1 + b3*(lnTam.mean)
  SD.above := b1 + b3*(lnTam.mean + sqrt(lnTam.var))
  '

# fit the model using nonparametric bootstrapping (this takes some time)
sem1 <- sem(model = moderation_model,
            data = SME,
            se = "bootstrap",
            bootstrap = 1000)
            
# fit measures
summary(sem1, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)

#compute bias-corrected estimates of bootstrapped confidence intervals
parameterEstimates(sem1, boot.ci.type = "bca.simple",
                   level = .95, ci = TRUE, standardized = FALSE) 
```

Thank you very much in advance!!!


DATR.csv

nick judd

unread,
Jul 31, 2019, 7:49:56 PM7/31/19
to lavaan
Do vartable(fit) to find the offending variables, then multiple of divide by a factor of 10.


Best,
Nick
Reply all
Reply to author
Forward
0 new messages