# Calculate total, direct and indirect effects in SEM with Lavaan package R

I wanted to ask if anyone knows how to obtain in a table the decomposition of the effect of the variables of a SEM model. I have made the model with the sem function of the lavaan package, but I don't know how to obtain the total, direct and indirect effects using the same package.

Thank you very much for your help.

You can use the := operator in lavaan syntax to define functions of estimated parameters, such as indirect and total effects. There is an example of this on the lavaan website's tutorial section:
The "new" parameters then appear in your summary() or parameterEstimates() output, along with (by default) a delta-method SE and associated normal-theory z test.