1
$\begingroup$

I have built SEM model in R using Lavaan. My aim is to report on the indirect effect.

The data I am using is confidential, so I will not be able to share it or provide a reproducible example. Since I am focused on the interpretation of the results, I don't think a reproducible example will be necessary. I will also provide some code and hypothetical results for simplicity.

To give some background, I am interested in the effect of two strains of a virus on severity (hospitalisation). And I am interested in how SES (income and education) mediates this relationship. I created a latent variable based on income and education. The part which makes this tricky for me to understand is that both my exposure (variant -> 1 = variant 1, 0 = variant 2) and outcome (hospitlaisation -> 1 = hosp, 0 = not hosp) are binary. SES variables are quintiles (Q1 = most educated / highest income) which were coded as numeric to work with Lavaan. All the examples I see online use numeric variables.

Code below:

library(tidyverse, lavaan)

full_model <- ' 
                latent_ses =~ income_q + educ_q
              
                status_hosp ~ a1*variant + b1*latent_ses + age + sex_Male + vaccination + comorbidities
                latent_ses ~  c1*variant 
                
                direct_modl := a1
                ses_modl := b1
                indirect_modl := c1*b1 
                total_model := a1 + c1*b1 
                '

model.fit1_full <- sem(full_model, data= d_o,  ordered="status_hosp")

parameter_est <- parameterEstimates(model.fit1_full, ci = TRUE, level = 0.95, boot.ci.type = 'perc') %>%    
   select(label, est, se, pvalue, ci.lower, ci.upper) %>%     
   filter(label == 'indirect_modl' |label == 'direct_modl' | label == 'ses_modl' | label == 'total_model') 

fit_meas <- fitMeasures(model.fit1_full, c("cfi", 'tli', 'rmsea', "srmr")) %>%   
   as.data.frame() %>% t()

Let's assume measures of fit(cfi, tli, rmsea, srmr) all appear to be good and latent variable loads well. Some hypothetical results are presented below. I will provide two hypothetical model representing scenarios where the direct effect and indirect effect are of same sign (direction) and of different.

Hypothetical result #1 
    > parameter_estimate

              label    est    se   pvalue 
    1   direct_modl  -0.50   0.05      0 
    2      ses_modl   0.25   0.04      0 
    3 indirect_modl  -0.12   0.01      0  
    4   total_model  -0.62   0.05      0  
    

Hypothetical result #2   
    > parameter_estimate

              label    est    se   pvalue 
    1   direct_modl  -0.50    0.05     0 
    2      ses_modl   0.29    0.04     0 
    3 indirect_modl   0.10    0.01     0  
    4   total_model  -0.40    0.05     0

  

My questions are:

  1. How can I interpret these results (specifically the indirect effect!) given that the outcome and exposure variables are binary.
  2. Is it right to be exponentiating the estimates given the outcome is binary (as with logistic model) Thanks in advance!
$\endgroup$
1
  • $\begingroup$ Hi again @capmo. Following your question from SO. I hope you get a richer discussion here. There, you mentioned "I think when using "ordered="status_hosp" in your sem call, that it automatically selects the most suited estimator for a binary variable.". No, it does not automatically select the most suited estimator. I believe the following discussion can be useful to you: stats.stackexchange.com/questions/24857/… $\endgroup$
    – hamagust
    Jun 6 at 17:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.