longitudinal mediation analysis

353 views
Skip to first unread message

Farideh Tavangar

unread,
Nov 18, 2019, 12:04:18 PM11/18/19
to lavaan
Hi,

I have a longitudinal dataset with X one-time point and continuous, MA and MB are the ordinal mediaotors( low, normal, high) in two-time points and Y is a continuous response with two-time points. I am using SEM package in R,

I really confused about how I can define the regression models and calculate direct and indirect effects?

Thanks

Terrence Jorgensen

unread,
Nov 18, 2019, 3:53:33 PM11/18/19
to lavaan
how I can define the regression models and calculate direct and indirect effects?

Is your question specifically about lavaan syntax or about SEM in general?

You can find lavaan examples of mediation syntax here:  http://lavaan.ugent.be/tutorial/mediation.html

You can find Cole & Maxwell's (2003) discussion of "half-longitudinal" designs, which match your situation, here:  https://doi.org/10.1037/0021-843X.112.4.558

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Farideh Tavangar

unread,
Nov 18, 2019, 6:20:26 PM11/18/19
to lav...@googlegroups.com
Thanks for your reply. 

Yes, I have done this lavaan example before. But my problem is that I have two ordinal mediators and two responses. With one X. Having this data, how I can define my modles and lable direct and indirect effects?

I appreciate your help.

Farideh

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/d46747c0-a149-4f3b-8d27-58896f6ba04d%40googlegroups.com.

Farideh Tavangar

unread,
Nov 18, 2019, 11:42:56 PM11/18/19
to lavaan


On Monday, November 18, 2019 at 6:20:26 PM UTC-5, Farideh Tavangar wrote:
Thanks for your reply. 

Yes, I have done this lavaan example before. But my problem is that I have two ordinal mediators and two responses. With one X. Having this data, how I can define my modles and lable direct and indirect effects?

I appreciate your help.

Farideh

On Mon, Nov 18, 2019, 15:53 Terrence Jorgensen <tjorge...@gmail.com> wrote:
how I can define the regression models and calculate direct and indirect effects?

Is your question specifically about lavaan syntax or about SEM in general?

You can find lavaan examples of mediation syntax here:  http://lavaan.ugent.be/tutorial/mediation.html

You can find Cole & Maxwell's (2003) discussion of "half-longitudinal" designs, which match your situation, here:  https://doi.org/10.1037/0021-843X.112.4.558

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+unsubscribe@googlegroups.com.

Terrence Jorgensen

unread,
Nov 19, 2019, 5:29:14 AM11/19/19
to lavaan
my problem is that I have two ordinal mediators and two responses. With one X. Having this data, how I can define my modles and lable direct and indirect effects?

X is just the predictor, not an outcome, so it doesn't need to be measured at Time 2 (unless you have hypotheses about its autoregressive effect).  Just allow the Time 1 variables to correlate, also allow Time 2 residuals to correlate, and have Time 1 variables predict Time 2 variables.  The paths to label should be obvious from your description (M2 ~ X is path "a", Y2 ~ M1 is path "b", Y2 ~ X is path "c").  For a visualization of the half-longitudinal design, see Slide 13:  https://slideplayer.com/slide/4448764/

Farideh Tavangar

unread,
Nov 19, 2019, 12:53:32 PM11/19/19
to lav...@googlegroups.com
Hi,

Are you recommending to use the following model? It seems I can't have two y2 as a response in the code, I got an error.

the two mediators  , MA and MB , are ordinal (low, normal, high) in tow time-points, how we define in the model this kind of data?

model <- '
#  structural regressions
         MA2 ~ a*X + MA1
         Y2 ~ c* X + Y1 + b *MA1
         Y2 ~ c'* X + Y1 + b' * MB1      (    Error: unexpected ')' in:"         Y2 ~ c* X + Y1 + b *MA1  )
         MB2 ~ a'* X + MB1

         # covariances
         Y1 ~~ MA1
         Y1 ~~ X
         MA1 ~~ X
         Y1 ~~ MB1
         MB1 ~~ X

         # lables
         Indirect:= (a'*b')+ (a*b)
         Total := c + c'+ (a'*b')+ (a*b)
         Prop  := Indirect/Total

         '

I have defined as a vector of ordered variables, but I got an error.

fit <- sem(model, data=data,ordered=c("MA1","MA2","MB1", " MB2"))

I really thanks for your help with me.

Farideh

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Terrence Jorgensen

unread,
Nov 19, 2019, 3:18:49 PM11/19/19
to lavaan
It seems I can't have two y2 as a response in the code

You can't define the same parameter twice on 2 different lines.  The only reason to define the parameter twice (which must be on the same line) would be to use 2 operators on it (e.g., assign a fixed or starting value as well as a label):

foo ~ myLabel*bar + 1?bar # first assigns a label, second assigns a starting value

In your syntax, you were trying to give 2 different labels (c and c') to the same parameter.  Another problem with your syntax was that you were not using alphanumeric characters in your labels (i.e., you cannot label a path c' because the quotation mark will be interpreted as ending the model's character string).  

I have defined as a vector of ordered variables, but I got an error.

It helps to paste the error messages.  But I'm guessing the issue is you have exogenous ordered variables (MA1 and MB1).  To avoid that, I think the most parsimonious solution would be to regress those on X as well.  In your case, it wouldn't change the interpretations of other parameters, and it would be a simple way to make the ordinal variables endogenous.  

Try this:


model <- ' # regressions
         MA1 ~ X # ad hoc
         MB1 ~ X # ad hoc
         Y ~ X # ad hoc

         MA2 ~ a1*X + MA1
         MB2 ~ a2*X + MB1

         Y2 ~ c*X + Y1 + b1*MA1 + b2*MB1

         # residual covariances at Time 1
         Y1 ~~ MA1 + MB1
         MA1 ~~ MB1
         # residual covariances at Time 2
         Y2 ~~ MA2 + MB2
         MA2 ~~ MB2

         # define indirect effects
         ab1 := a1*b1
         ab2 := a2*b2
         Indirect := ab1 + ab2
         Total := c + Indirect
         Prop  := Indirect/Total
'

Farideh Tavangar

unread,
Nov 20, 2019, 12:12:56 AM11/20/19
to lav...@googlegroups.com
Dear Terrence,

I really appreciate all your help with me. Now I feel better.

1 ) Regarding your suggestion to regress the mediators on X, does it work for both continuous and dichotomous mediators?

I mean, my mediators originally were continuous, and I recoded them to low, normal and high( it is a biological factor). So, it wouldn't matter I use continuous or dichotomous mediators? 

It helps to paste the error messages.  But I'm guessing the issue is you have exogenous ordered variables (MA1 and MB1).  To avoid that, I think the most parsimonious solution would be to regress those on X as well.  In your case, it wouldn't change the interpretations of other parameters, and it would be a simple way to make the ordinal variables endogenous.  

2 ) one of the mediators was almost constant( all normal case, but one), that's why I got an error in the previous code. I used this one and got the results.  
      fit <- sem(model, data=data,ordered=c("MA1","MA2"))

But I am wondering, why we don't use multinomial or logistic regression in our model when our mediators are not continuous in lavaan package with the sem function?

3) in order to have the path diagram of the model, which code goes with sem function and lavaan package?

Thanks so much

Farideh 
                                                                 



--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Terrence Jorgensen

unread,
Nov 20, 2019, 5:09:04 AM11/20/19
to lavaan

1 ) Regarding your suggestion to regress the mediators on X, does it work for both continuous and dichotomous mediators?

I mean, my mediators originally were continuous, and I recoded them to low, normal and high( it is a biological factor). So, it wouldn't matter I use continuous or dichotomous mediators? 

Discretizing continuous variables only throws away information.  At best, this lowers power, and at worst it can induce spurious effects in your discretized data.

http://quantpsy.org/pubs/maccallum_zhang_preacher_rucker_2002.pdf (they talk about dichotomization, but the same principles apply to trichotomization)

If you analyze your original continuous variables, that simplifies a lot.  With ordered outcomes, lavaan has to assume they are discretized versions of a normally distributed latent variable (which is actually observed in your data).  You don't have to assume normality of the original continuous mediators, if you use a robust estimator for nonnormality (if that is necessary).

It is also simpler because you don't have to come up with strange ways of treating an ordinal exogenous variable as though it were endogenous.  So you would not have to regress any Time-1 variables on X, just let all of them covary with X. 

 
2 ) one of the mediators was almost constant( all normal case, but one), that's why I got an error in the previous code. 

That is another good reason not to discretize the original variable, which might have more variance (distinguishing between different people in the "normal" category).


But I am wondering, why we don't use multinomial or logistic regression in our model when our mediators are not continuous in lavaan package with the sem function?

Yves has experimented with the logit link, but it is much more difficult to obtain estimates, and requires marginal ML estimation (more computationally intensive than DWLS).  The probit link is more associated with the nice latent-variable interpretation we like in SEM, although you can make that interpetation with the logit link as well (just assume residuals follow a logistic instead of normal distribution).  But computationally, the underlying normality assumption just simplifies a lot of computations.
 
3) in order to have the path diagram of the model, which code goes with sem function and lavaan package?

You can try the semPlot package.  The semPaths() function in that package accepts fitted lavaan models, although it takes quite some effort to improve their quality enough for publication.  Here is a link to a blog post you might find helpful:  https://statistics.ohlsen-web.de/sem-path-diagram/

Farideh Tavangar

unread,
Nov 20, 2019, 12:40:09 PM11/20/19
to lav...@googlegroups.com
Dear Terrence,

Regarding your note

Discretizing continuous variables only throws away information.  At best, this lowers power, and at worst it can induce spurious effects in your discretized data.  

I used both continuous mediators in the model you suggested me, and I got 

Akaike (AIC)                                         709.586
  Bayesian (BIC)                                     744.006
  Sample-size adjusted Bayesian (BIC)          672.264

Root Mean Square Error of Approximation:

  RMSEA                                                   0.142    very poor fit
  90 Percent confidence interval - lower         0.000
  90 Percent confidence interval - upper         0.325
  P-value RMSEA <= 0.05                          0.187

with the proportion of indirect effect   1.517.  what is wrong with it?

        Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)
    ab1               0.015    0.027    0.562    0.574
    ab2               0.016    0.023    0.686    0.493
    Indirect          0.031    0.036    0.863    0.388
    Total             0.021    0.076    0.270    0.787
    Prop              1.517    5.141    0.295    0.768

and Then I deleted the second continuous mediator( which its dichotomised was constant), and I got the better result.

Akaike (AIC)                                          599.821
  Bayesian (BIC)                                       619.276
  Sample-size adjusted Bayesian (BIC)          578.726

Root Mean Square Error of Approximation:

  RMSEA                                                    0.000     very good fit
  90 Percent confidence interval - lower         0.000
  90 Percent confidence interval - upper         0.336
  P-value RMSEA <= 0.05                          0.716

with the proportion of the indirect effect

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)
    ab1               0.014    0.026    0.539    0.590
    Indirect          0.014    0.026    0.539    0.590
    Total             0.017    0.073    0.235    0.814
    Prop              0.803    3.215    0.250    0.803

1 ) do you think I should drop the second mediator of the model?

and when I used the first ordered mediator ( I dropped the constant mediator) I got the following results: ( the mediator sample size is 32)
                                                                 n= 32      n=215 ( base line)
 RMSEA                                                      0.183       0.148
  90 Percent confidence interval - lower         0.000       0.000
  90 Percent confidence interval - upper         0.545       0.521
  P-value RMSEA <= 0.05                          0.167       0.210
                                                                 
  Robust RMSEA                                                        NA
  90 Percent confidence interval - lower                     0.000
  90 Percent confidence interval - upper                        NA

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)
    ab1              -0.001    0.008   -0.089    0.929
    Indirect         -0.001    0.008   -0.089    0.929
    Total             0.008    0.083    0.098    0.922
    Prop             -0.082    1.469   -0.056    0.956

2 ) Why I don't have AIC, BIC anymore? and rather, I have  Robust RMSEA?  

3 ) shall I explain that the second mediator should be excluded from the model because the model does not fit? and of course, it is not the case to report for a paper?

4) How can I use Robust ML to cover the non-normal data?

5) which condition on data should be met to use SEM, which data exploration techniques?

Sorry, I ask so many questions, you really saved me in my research.

Thanks so much,

Farideh





--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Terrence Jorgensen

unread,
Nov 21, 2019, 9:07:38 AM11/21/19
to lavaan
1 ) do you think I should drop the second mediator of the model?

I would be more curious why the results differ so much.  How is the continuous variable distributed?  Look at lavResiduals() output to see which specific relationships are not adequately reproduced by the model.  In fact, I expected your model to be saturated (arbitrarily perfect fit with df = 0).  You need to start posting 
 
and when I used the first ordered mediator ( I dropped the constant mediator) I got the following results: ( the mediator sample size is 32)

That is a lot of missing data on the mediator.  Are you setting missing = "FIML" when you use ML estimation for the continuous variables?  That will prevent throwing away a lot of data, although it assumes a MAR mechanism.  That option is not available for DWLS estimation, but you could request missing = "pairwise", which also uses as much info as possible, but assumes MCAR mechanism.

2 ) Why I don't have AIC, BIC anymore? and rather, I have  Robust RMSEA?  

Because those are only available when using a likelihood-based estimator.

3 ) shall I explain that the second mediator should be excluded from the model because the model does not fit? and of course, it is not the case to report for a paper?

I can't comment on that.  I know almost nothing of your data or theory.  As I suggested above, I would first try to understand why the hypothesized model does not fit well, as well as understand why your model has degrees of freedom even though you:
  • estimate all paths from Time 1 to Time 2
  • freely covary all Time 1 variables
  • freely covary all Time 2 residuals
Perhaps you are not specifying your model correctly.

4) How can I use Robust ML to cover the non-normal data?

Set estimator = "MLR", which is compatible with missing = "FIML".  It will provide robust (Huber-White sandwich-style) SEs, and the Yuan-Bentler scaled test statistic.

5) which condition on data should be met to use SEM, which data exploration techniques?

I'm not sure what you are asking.  ML estimation assumes multivariate-normal observed variables, but robust estimators free you from that assumption, as long as the indicators are continuous.  DLWS estimation assumes the latent responses underlying observed ordinal variables, as well as any continuous observed variables, are jointly distributed multivariate normal in order to estimate polychoric/polyserial correlations (to which the model is then fitted).  SEM also requires large samples because the test statistics are all based on asymptotic theory.  Given you only have 7 variables in your model, N ~ 200 is probably a good size.  SEM also assumes independence of observations, unless clustering is accounted for by modeling their effects or marginalizing over them.

Farideh Tavangar

unread,
Nov 21, 2019, 2:07:21 PM11/21/19
to lav...@googlegroups.com
Dear Terrence, 

Thanks for your reply again.

My data includes  Chronic stress ( X), a questionnaire range from 0-11, only measures at baseline, its dis. looks like symmetric normal.
The two mediators are continuous with one outlier at time point two, but we recoded them as an ordinal( low, normal and high) mediators. They are biological factors, cortisol and glycated haemoglobin.one of the ordered mediators is almost constant in both time points.
the response is again a questionnaire ( pregnancy-related anxiety, ( PRA)) which its questions are added to make a total score, we treated it as a continuous response. 
our hypothesis is that if biological factors mediate the rel btw Chronic stress and PRA? 

When I used 
fit <- sem(model, data=data,estimator = "MLR", missing = "FIML")    including both continuous mediators,
I got the following output.

lavaan 0.6-5 ended normally after 97 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of free parameters                         29        it was 23  with fit <- sem(model, data=data )  
                                                     
  Number of observations                           215
  Number of missing patterns                         6        I didn't have this result when I used  fit <- sem(model, data=data )  
                                                     
Model Test User Model:
                                                    Standard      Robust
  Test Statistic                                    5.678       8.333
  Degrees of freedom                                 4           4
  P-value (Chi-square)                           0.225       0.080
  Scaling correction factor                                  0.681
    for the Yuan-Bentler correction (Mplus variant)

Model Test Baseline Model:

  Test statistic                                41.758      49.045
  Degrees of freedom                                21          21      
  P-value                                        0.005       0.000
  Scaling correction factor                                  0.851

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.919       0.846
  Tucker-Lewis Index (TLI)                       0.576       0.189
                                                                 
  Robust Comparative Fit Index (CFI)                         0.876
  Robust Tucker-Lewis Index (TLI)                            0.351

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)               -935.559    -935.559      it was  -331.793
 
Scaling correction factor                                           1.239
      for the MLR correction    

  Loglikelihood unrestricted model (H1)       -932.720    -932.720    it was   -328.456
  Scaling correction factor                                             1.172
      for the MLR correction                                      
                                                                 
  Akaike (AIC)                                           1929.119    1929.119   it was   709.586  
  Bayesian (BIC)                                        2026.867    2026.867              
744.006
  Sample-size adjusted Bayesian (BIC)         1934.972    1934.972            
 672.264

  Root Mean Square Error of Approximation:

  RMSEA                                                     0.044       0.071          it was       0.142

  90 Percent confidence interval - lower         0.000       0.000
  90 Percent confidence interval - upper         0.119       0.154
  P-value RMSEA <= 0.05                              0.462       0.259
                                                                 
  Robust RMSEA                                                         0.059

  90 Percent confidence interval - lower                         0.000
  90 Percent confidence interval - upper                         0.115

Standardized Root Mean Square Residual:

  SRMR                                                          0.057       0.057

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)
    ab1               0.014    0.035    0.404    0.686
    ab2               0.012    0.020    0.590    0.555
    Indirect          0.026    0.042    0.621    0.535
    Total            -0.021    0.048   -0.439    0.661
    Prop             -1.213    4.223   -0.287    0.774        proportion was 1.517   so it is "inconsistent mediation", right ?????

 lavResiduals(fit)       ** How we can interpret this table? which kind of numbers shows a good fit?
$type
[1] "cor.bentler"

$cov
            Crt_T1 H_T1   PRA1   Crt_T2 H_T2   PRA2   chronic st
Cortisol_T1  0.003                                          
H_T1         0.002  0.001                                  
PRA1        -0.013 -0.004  0.000                            
Cortisol_T2  0.035  0.133  0.104  0.030                    
H_T2        -0.027 -0.001  0.268  0.071  0.007              
PRA2        -0.003  0.020  0.019  0.018  0.004  0.003      
chronic st     -0.002 -0.002  0.000  0.008  0.017 -0.001  0.000

$mean
Cortisol_T1        H_T1        PRA1 Cortisol_T2        H_T2        PRA2     chronic st
     -0.002      -0.004       0.000       0.039       0.055       0.001       0.000

$cov.z
            Crt_T1 H_T1   PRA1   Crt_T2 H_T2   PRA2   chronic st
Cortisol_T1  0.208                                          
H_T1         0.096  0.028                                  
PRA1        -0.305 -0.058  0.000                            
Cortisol_T2  0.708  1.111  0.650  0.616                    
H_T2        -0.154 -0.025  1.629  0.658  0.062              
PRA2        -0.076  1.968  1.564  1.058  0.052  0.955       
 chronic st      -0.306 -0.090  0.000  0.464  0.852 -0.565  0.000

$mean.z
Cortisol_T1        H_T1        PRA1 Cortisol_T2        H_T2        PRA2     chronic st
     -0.207      -0.840       0.000       1.018       1.321       1.788       0.000

$summary
       srmr srmr.se srmr.z srmr.pvalue usrmr usrmr.se
cov   0.064   0.032  0.000       0.500 0.000    0.065
mean  0.028   0.012  0.608       0.272 0.019    0.025
total 0.059   0.029  0.000       0.500 0.000    0.059

when I used fit <- sem(model, data=data ) , I got the following tables:

 lavResiduals(fit)
$type
[1] "cor.bentler"

$cov
            Crt_T1 H_T1   PRA1   Crt_T2 H_T2   PRA2   chronic st
Cortisol_T1  0.000                                          
H_T1         0.000  0.000                                  
PRA1         0.000  0.000  0.000                            
Cortisol_T2  0.005  0.201  0.059  0.004                    
H_T2        -0.063 -0.012  0.271  0.096 -0.013              
PRA2        -0.018  0.014  0.086  0.030  0.027  0.017      
chronic st . 0.000  0.000  0.000  0.000  0.000  0.000  0.000

$cov.z
            Crt_T1 H_T1   PRA1   Crt_T2 H_T2   PRA2   chronic st
Cortisol_T1  0.000                                          
H_T1         0.000  0.000                                  
PRA1         0.000  0.000  0.000                            
Cortisol_T2  0.471  1.249  0.371  0.472                    
H_T2        -0.471 -1.249  1.919  0.922 -1.249              
PRA2        -0.471  1.249  1.963  1.005  0.963  1.046      
chronic st      0.000  0.000  0.000  0.000  0.000  0.000  0.000

$summary
     srmr srmr.se srmr.z srmr.pvalue usrmr usrmr.se
cov 0.072   0.023  0.606       0.272 0.042    0.043

I appreciate all your help with me.

Farideh


--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Terrence Jorgensen

unread,
Nov 22, 2019, 6:49:51 AM11/22/19
to lavaan
The two mediators are continuous with one outlier at time point two

If you are worried about the influence of the outlier, you could create a copy of the variable that recodes the outlying value as missing.  Then compare your results using both versions of the variable, to see how much the outlier affects the results.  

The regsem package provides outlier-robust estimation algorithms, if you find the results/conclusions are quite sensitive to the outlier.

 
fit <- sem(model, data=data,estimator = "MLR", missing = "FIML") 

Either dd the argument fixed.x = FALSE, or just set missing = "fiml.x" to make sure any missing values on the exogenous Time-1 variables are also retained in the analyzed data.

Model Test User Model:
                                                    Standard      Robust
  Test Statistic                                    5.678       8.333
  Degrees of freedom                                 4           4
  P-value (Chi-square)                           0.225       0.080
  Scaling correction factor                                  0.681
    for the Yuan-Bentler correction (Mplus variant)

Make sure you use the Robust column.  The test is not significant, so you cannot reject the null hypothesis that your model reproduces the data's summary statistics exactly. 
 
  Robust Comparative Fit Index (CFI)                         0.876
  Robust Tucker-Lewis Index (TLI)                            0.351

The low values here are probably due to the baseline model not fitting poorly enough.  Use the nullRMSEA() function in the semTools package to print the baseline model's RMSEA.  If it is not > 0.158, Kenny recommended not using CFI/TLI to evaluate approximate fit.  Of course, you can't reject perfect fit, so there is no reason to refer to approximate fit indices anyway.

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)               -935.559    -935.559      it was  -331.793
 
Scaling correction factor                                           1.239
      for the MLR correction    

  Loglikelihood unrestricted model (H1)       -932.720    -932.720    it was   -328.456
  Scaling correction factor                                             1.172
      for the MLR correction                                      
                                                                 
  Akaike (AIC)                                           1929.119    1929.119   it was   709.586  
  Bayesian (BIC)                                        2026.867    2026.867              
744.006
  Sample-size adjusted Bayesian (BIC)         1934.972    1934.972            
 672.264

These are based on sums of individual log-likelihoods, so the larger your sample, the larger they will be.  Using FIML retains your full sample, instead of cutting it down to N=23 complete cases.

  Robust RMSEA                                                         0.059
  90 Percent confidence interval - lower                         0.000
  90 Percent confidence interval - upper                         0.115

The 90% CI is so wide, you cannot reject the null hypotheses of exact, close, adequate, or poor fit.  It is not estimated precisely enough to be useful.

Standardized Root Mean Square Residual:

  SRMR                                                          0.057       0.057

Not bad, but the mean is not as informative as individual standardized residuals.


Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)
    ab1               0.014    0.035    0.404    0.686
    ab2               0.012    0.020    0.590    0.555
    Indirect          0.026    0.042    0.621    0.535
    Total            -0.021    0.048   -0.439    0.661
    Prop             -1.213    4.223   -0.287    0.774   it is "inconsistent mediation", right ?????

Yes, if your indirect and direct effects are in opposite directions, that is "inconsistent mediation", so the proportion index is meaningless as an effect size. The standardized solution provides standardized indirect effects, interpreted in units of SD.


 lavResiduals(fit)       ** How we can interpret this table? which kind of numbers shows a good fit?
$type
[1] "cor.bentler"

$cov
            Crt_T1 H_T1   PRA1   Crt_T2 H_T2   PRA2   chronic st
Cortisol_T1  0.003                                          
H_T1         0.002  0.001                                  
PRA1        -0.013 -0.004  0.000                            
Cortisol_T2  0.035  0.133  0.104  0.030                    
H_T2        -0.027 -0.001  0.268  0.071  0.007              
PRA2        -0.003  0.020  0.019  0.018  0.004  0.003      
chronic st  -0.002 -0.002  0.000  0.008  0.017 -0.001  0.000

$mean
Cortisol_T1        H_T1        PRA1 Cortisol_T2        H_T2        PRA2     chronic st
     -0.002      -0.004       0.000       0.039       0.055       0.001       0.000


The $cov table is the difference between observed covariance matrix and the model-implied covariance matrix, standardized by dividing by the observed SD.  Values > 0.1 are generally considered important enough differences to warrant attention.  The $cov.z table shows that the large residuals are still not significant (z statistics are < 1.96), which is consistent with the overall test of model fit not being significant.  It is up to you whether you want to take those large residuals seriously.  I would at least consider the biggest one to be not-ignorable.  Think about how the relationship between those 2 variables could be improved in the context of your model.  I'm guessing you are not estimating the direct effect of PRA1 on H_T2 because you hypothesize full mediation, but perhaps the data are suggesting there is some reciprocal causation.

Farideh Tavangar

unread,
Nov 23, 2019, 11:29:56 PM11/23/19
to lav...@googlegroups.com
Many thanks to you, I am really learning better.

I just wonder,
1)  what would be the effect of time on this mediation, I mean how we can interpret these results in terms of time?
2 ) Is it possible to find out which time interval would be better, or what would be the right time to do these questionnaires on pregnant women ( our participants)?

I appreciate all your help with me.

Best,

Farideh

 

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Terrence Jorgensen

unread,
Nov 25, 2019, 6:08:25 AM11/25/19
to lavaan
1)  what would be the effect of time on this mediation, I mean how we can interpret these results in terms of time?

Your results are conditional on the observed time interval.  If there were a different interval between occasions, then the causal effects would almost certainly differ (even in the population: this is not merely a sampling-error issue).

2 ) Is it possible to find out which time interval would be better, or what would be the right time to do these questionnaires on pregnant women ( our participants)?

Not with only 2 occasions of measurement.  This article should be quite informative for you:


You would not be able to fit that model in lavaan, but I believe the authors provide OpenMx syntax (another R package for SEM).

Farideh Tavangar

unread,
Nov 26, 2019, 10:21:59 AM11/26/19
to lav...@googlegroups.com
Dear Terrence,

Thanks a lot for being so patient to me. 

I would appreciate if you answer the following questions:

1) How can I fit bivariate structural cross-lagged models?  and is it necessary for my data? and what is measurement variance in the longitudinal analysis?
The X in my model is chronic stress related to the time before 18 years old for pregnant women since all our pregnant women are older than 18 years, I think there is no lagg- difference between X and mediator( biological factors during pregnancy) and Y ( anxiety during pregnancy. am I right?

2 ) the proportion of indirect effect in my model was 1.542 and you said maybe my model is not properly defined. I fit the mediator models for both time points separately, using PROCESS Procedure for SPSS Written by Andrew F. Hayes, with the continuous mediators, and I got the different directions in tow time points. I think that's why I got proportion of 1.542 for the indirect effect. Am I right?


Direct effect of X on Y  in Time 2
     Effect         se          t          p       LLCI       ULCI
     -.0254      .0750     -.3384      .7371     -.1776      .1269
 
Indirect effect(s) of X on Y:
                   Effect     BootSE   BootLLCI   BootULCI
TOTAL         .0219      .0260     -.0289      .0779
Cortisol       .0116       .0203     -.0168      .0653 
H_T1          .0103      .0190     -.0339      .0446 


direct effect of X on Y in Time 1
     Effect         se          t          p       LLCI       ULCI
     -.0434      .0898     -.4835      .6307     -.2236      .1368
 
Indirect effect(s) of X on Y:
                 Effect     BootSE   BootLLCI   BootULCI
TOTAL      -.0296      .0345     -.1148      .0214
Cortisol     -.0067      .0198     -.0597      .0211
H_T1         -.0229      .0255     -.0833      .016


3) when I ask for lavresiduals for the ordered mediators( low=1, normal=0, high=2) , I got the all zero in the last line. What does that mean?  adj_cortisol_T1/ T2 and  adj_H_T1 /T2 are the mediators in Time one and two. PRA is the response( continuous)

> lavResiduals(fit)
$type
[1] "cor.bentler"

$res.cov
                        ad__T1 PRA1   a_H_T1 ad__T2 a_H_T2 PRA2  
adj_cortisol_T1  0.000                                  
PRA1               -0.063  0.000                            
adj_H_T1         0.132 -0.014  0.000                    
adj_cortisol_T2 -0.024 -0.494  0.000 -0.056              
adj_H_T2         -0.530  0.635  0.000 -0.807  0.000      
PRA2                0.000  0.000  0.000  0.000  0.000  0.000

$res.int
adj_cortisol_T1            PRA1        adj_H_T1 adj_cortisol_T2        adj_H_T2
              0               0               0               0               0
           PRA2
              0

$res.th
adj_cortisol_T1|t1 adj_cortisol_T1|t2 adj_cortisol_T2|t1        adj_H_T2|t1
                 0                  0                  0                  0


Once again, thanks for your help with me.

Farideh

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Terrence Jorgensen

unread,
Nov 29, 2019, 6:03:57 AM11/29/19
to lavaan
2 ) the proportion of indirect effect in my model was 1.542 and you said maybe my model is not properly defined. 

No, I said the proportion index is not meaningful when you have inconsistent mediation.

Farideh Tavangar

unread,
Dec 3, 2019, 4:54:50 PM12/3/19
to lav...@googlegroups.com
Dear Terrence,

I just wanted to thank you for all your help with me. I learned a lot from you and this amazing group.

All the best,

Farideh

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages