 So one of the main kinds of models that analysts will use structural equation models for are for mediation kinds of models. One can estimate mediation models in other modeling frameworks but SEMs are particularly well suited to mediation models. What we are talking about really here is a focus on not simply the direct effects of one variable on another which is what we are implicitly focusing on and often explicitly focusing on in an OLS context but we want to decompose the effects of one variable on another into those direct effects but also effects that are running through other variables in the system. So we are going to be interested in the indirect as well as the direct and the total effects and this is because oftentimes what we are interested in is understanding causal mechanisms not just whether two variables are causally related but how they are causally related. So we might for example conclude that gaining a degree at university increases your earnings it might have a causal effect on your earnings in later life and that's a useful and interesting conclusion to be able to draw but there might be secondary questions about how that actually happens what is the mechanism that underlies the earnings return to gaining a degree. From a sort of human capital perspective we might expect this to be through increasing the individual's skill level or their productivity which would then from economic theory lead us to expect them to have higher earnings. On the other hand from a more kind of sociological perspective it might just be that the degree is just a credential and that it hasn't really endowed the individual with any greater skill or productivity but it's just given them a certificate which enables them to get to the top of the queue ahead of people who don't have that degree and those kinds of mechanism questions are often very important for policy and are at the heart of what we're doing when we're fitting mediation models. We've seen a couple of examples of path diagrams with mediation already and here we see an example where we have Eta2 a latent variable which is regressed on Eta1 and we have a third variable Z which is our kind of exogenous variable here and we can look at the the different effects that X has on Eta2. First of all the the direct effects of Z on Eta2 is the beta-weight beta-3 here the the direct path so that's what we would normally be focusing on in a regression equation that direct effect. But we can also estimate the indirect effect here because we've got the beta-1 coefficient of Eta1 on Z and the beta-2 coefficient of Eta2 on Eta1. Now if we take the product of those two parameters then that will give us the indirect effect of Z on Eta2. So that's how we can algebraically recover the the indirect effect of one variable on the other is taking the product of the two beta-weights. Then we will perhaps be interested in the total effect and this is the sum of the indirect and the direct effect. So we might find for example that both direct and indirect effects are non-significant but there is still a significant total effect. So we can get different patterns of an understandings of an effect of one variable on another by looking at these different effect parameters. We sometimes distinguish between partial and perfect mediation. So for example if we fitted a model that just regressed Eta2 on Z and we found a significant and substantial effect there then if we add in the Eta1 predictor if the effect of Z now becomes non-significant but the indirect effect is significant then we would refer to this as perfect mediation. All of the effect of Z on Eta2 flows through Eta1. Where there is still a residual effect i.e. a significant path between Z and Eta2 that would be referred to as partial mediation. Now as I said we can specify these kinds of models using a series of OLS models and we can recover the indirect effects by taking the product of the respective direct effects to get the indirect and total effects. One of the advantages of doing this in a SEM framework using SEM software however is that those kind of calculations are done for you and just provided in the output and additionally there are various ways of directly calculating the standard errors of those indirect paths. So we can either calculate the standard errors for these mediated paths using what's called the delta method a parametric approach which assumes multivariate normality or more commonly now using non-parametric approaches like bootstrapping resampling from the sample data to generate an empirical sampling distribution. If we do that of course we need to have the raw data rather than the covariance matrix. So the SEM framework is very convenient for doing this kind of modeling. We can have more complex mediated paths that run not just from one variable through another to a third variable but through several variables and we can get estimates of those indirect and total effects and their standard errors. Here's an example again using the European Social Survey an actual model here where we are looking at the effect of being in a high income group your income on your level of social trust and breaking that down into the direct effect of income on social trust through and also the indirect effect through your level of happiness or life satisfaction. You can see here that the beta weights on the path diagram there indicate that there are these are standardized parameter estimates and so you can see that there is an effect of being high income on social trust and there seems to be an indirect path there so we could just take the product of the 0.09 and the 0.35 parameters to get the indirect effect. If we do that we get a figure about 0.32 which if you look at this slide here you can see this is some output from AMOS software and you can see there that in red the indirect effect of the column variable which is high income on the row variable which is social trust is 0.032 which is the product of those two coefficients to give you the indirect effect and you can see that all of the possible path estimates are provided there directly in the output and also in SEM software you will get as I said the standard parameters either through bootstrapping or parametric estimation and here we see that the two-tail p-value for that indirect effect of income on social trust is significant at the 95% level of confidence so we could reject the null hypothesis that there is no indirect path between income and social trust. So that's a very brief look at the way that we can fit mediation models and what some of the advantages are of doing this within a SEM context. It's important to remember a couple of limitations here one is that in this kind of modeling environment we're really limited to continuous mediating variables we are difficult to estimate these kinds of models when the z variable is continuous and when we have a mix of continuous and categorical variables. It's also really not a framework for the kind of clean causal effect estimates and that we were talking about in the in the previous video on instrumental variables really this is just decomposing covariances there are other approaches that have a more of a causal estimate focus using the sort of the potential outcomes framework and that would be using g computation and so on and we won't be covering those in this video but it's important to be aware that there are other frameworks for estimating these kinds of mediation models which are a bit more modern and have a more robust causal influence behind them.