 Tracing rules for path analysis can be used to calculate correlations for models. This same set of rules can be extended so that it applies to covariances as well. Let's take a look at how we calculate covariances using the path analysis tracing rules. This explanation from Wikipedia is a bit complex, but we can see that the two-headed arrows play a bit of a special role in these additional rules that we need to apply for tracing covariances. I will not read you out these rules, but let's just take a look at how we actually apply path analysis tracing rules to covariances. Let's start with this simple model. One of the problems with this simple recursive model is that there are not many two-headed arrows that we can trace with. What we need to do first is to make the variances explicit. The idea of a two-headed arrow is that it can quantify either a correlation or covariances, which it does here, but we can also use two-headed arrows to quantify variances or show variances in this kind of path diagram. Variances are simply variables covariances with itself, so we can add these variances of x1, x2 and x3 and the error term to make the variances more explicit. Then we can start tracing, so I'll just show you the result. How do we come up with that result? If we want to calculate the covariances between x and y, we start from x and we always have to go back until we hit the two-headed arrow and then we trace down. We trace back, we are here, start with, so we take the two-headed arrow immediately and then we trace down to y. Same here, we can go from x1, two-headed arrow to x2, back x1, two-headed arrow x3 and then down to y. We trace always backwards to the closest two-headed arrow or we can start with a two-headed arrow and then we trace forward. When we calculate the variance of y, the equation is a bit more complicated. We start from y, we trace up to x1, then we turn around, we take that variance here, we go to y, then we trace to x2, we turn around using that two-headed arrow, we go back to y, x3, two-headed arrow back to y and that gives us the three first lines of this equation here. Then we do the covariances, like we would do correlations using normal path analysis tools without the covariances extensions and then we just add the variance of the error term. That gives us the variance of y. So it's pretty simple when we have a recursive model. When we have multiple recursive models, like mediasive models, things get a bit more complicated. One problem is that when we estimate this kind of model, we estimate the variance of x or we take that from the sample, we estimate error variance, we estimate that error variance, but the variances of y and variance of m are not model parameters. What that means is it's not important the context of this video, but if you apply structurally as a model software, for example, it doesn't tell you what is the variance of m, it's not part of the model, you can calculate it afterwards. But because we work with observed variables here, we know the variance of m and we can just mark it here in our path diagram because it's a known quantity. And that simplifies the path tracing. We would calculate the covariance between m and y by starting from m, we take the variance of m here and we trace down to y. Then we start from m, we trace up to x, we take the two-headed error variance of x and then we trace back down to y and that gives us the variance. The variance of y is given by this equation. How it works is that we go from y, we go to m, we take the two-headed error of the variance, we come back, we travel to x, we take the two-headed error, we come back to y and then we go up, we take the two-headed error from x, beta m1 and beta y2 so we can come back the other way and then we can go also up m, x, two-headed error and then start tracing down. So we always trace back until we find a two-headed error and then we take the two-headed error and then we start tracing down. So first up, then two-headed error, then down, or we can start with two-headed error and then go straight down. So that's basically how the rules are applied. So this was a simple way of using the short hand of assuming that we know the variance of error. But if the variance of m is for example latent variable, then we wouldn't know its variance and then we are in a bit more complicated situation. So we can also apply these rules in a different way that is more general, but it's slightly more complicated. So we can also calculate the course with m and y like that. We would go from m and we go up to u, m. We take the two-headed error of the variance, we go down to m and then we go to y. So we trace up from m, we take two-headed error and then we trace down. We go from m, we go up to x, we take two-headed error and then we come back down to y. So that is the second line here. Or we go up two-headed error of x and then down to y. So that's the third line. So we can travel to these exogenous variables if we start from this endogenous variable m. So the endogenous variable is a variable which has an incoming path and exogenous variable is a variable that doesn't have an incoming path. Use the green and orange colors on my slides to indicate exogenous and endogenous variables in path diagrams. The variance of y is given with this kind of equation. So how we calculate that or trace that is that we first go to m, u, m and back. We go x and back. We go x, beta m1, beta y2. We go the same the other way around and then we go x and back and then we go u and back. And that gives us the variance of y. So we always trace to all the exogenous variables. We turn around the exogenous variables including error terms and then we come back to the dependent variable y, whose variance we are interested in. This kind of tracing is related to something that econometricians call reduced form equations. So the idea of a reduced form equation in this kind of path diagram is that all endogenous variables can be expressed as linear functions, linear models, as linear functions or weighted sum of the exogenous variables. So y is the sum of this error term, this error term and x and here are the multipliers. And if you wonder where this two comes from, so why do we count this path when we go to x and then back, why do we count it twice? It comes because when we calculate variances we always square the multipliers of the variables and the multiplier for x is this sum. And when we square a sum then we square the elements of that sum, we sum them together and then we add two times their product. This is high school math. Let's compare these two ways. So we have two different ways of calculating. We have the one that applies to reduced form principle that we go from all variables to exogenous variables and then we turn back. And then we had a little trick where we used the fact that we actually know the variance of m from data and then we can come back. So does it mean that this covariance with m and y can take two different values? Well no, we can reorganize this equation in a bit different way. So we have just one line where we have beta y2 and this part of the equation actually gives the variance of 1. So we are actually just calculating the variance of 1, then multiplying it by beta y2. So this is how the path analysis tracing rules work for understand the last models when we are covariances. One important thing to check always and to remember always is that each path must have one and only one variance or covariance. If you check that and then you include all variances and covariances into the model, we are using the all possible paths, then you should get it correctly.