From the course: Introduction to jamovi

ANCOVA

- When you compare the means of multiple groups, the most common approach is the analysis of variance, but sometimes you want to use a quantitative or continuous variable as a predictor as well. In that case, the most common choice is going to be the analysis of covariance or ANCOVA. Fortunately this is really easy to do in Jamovi. And to demonstrate this, I'm going to use the iris dataset. And what this gives is data on three species of iris flowers. There is the setosa, and the versicolor, and the virginica. And for this, it gives the length and width of the petal and the sepal, which looks like a petal, of fifty flowers of each species. And what we're going to look at, is the sepal width in particular. Now, I want to start by showing you this one thing. We're going to come up here to Exploration, and just do the basic Descriptives. And I want to take the Sepal Width as the Variable, and look at a density plot for this. And what you can see for this, is that, well, we have this basically normal distribution, but if we split it by species, then we see some big differences. Mostly we see that the blue density plot here, the top, for setosa, it looks basically bigger than the green and the red ones for the other two species. And so we may want to do an analysis of variance to compare these. So, the way you would do that, is by simply setting up the one-way analysis of variance, but I do want to show you a complicating factor here, and that is that the Sepal Length is a Predictor as well. And in fact, the way we're going to do that is by coming back to Exploration, and if you have the Scatter module installed, if you don't, you install it by going to the plus on the right side where it says Modules, and you install Scatter, S-C-A-T-R. I'm going to use this Scatterplot here, and we're going to use the Sepal Length as a predictor of Sepal Width. Now Sepal Width is the one that we're interested in. And what you see right here, is, if I put the regression line through it, and I even put a Standard error, is that's basically flat. There's no association between these two things overall. And I'm going to close this, so we can save this one, but then I'm going to do again, I'm going to come down to Scatter again, and I'm going to put Sepal Length on the X-Axis as a Predictor, and Sepal Width on the Y-Axis as the Outcome. But this time I'm going to break it down by species. And now what you see, is when we put it there, is there is this really big separation. The red group is the setosa ones, and those are the ones that we saw as larger when we looked at their density. This means that an analysis of covariance might be an appropriate thing. So let's go and do that right now. We go to ANOVA and come down to ANCOVA for analysis of covariance. And we've got a lot of options here, but I want to go through and show you just the basics. The first thing is the Dependent Variable, or the Outcome. And we're using Sepal Width, I'm going to put that right there. Fixed factors is the normal or categorical variable that you're using to define the groups. In this case, that's Species. And you can see the tables filling in, and it's telling us there's a difference between the species, that they're not all the same. But I'm also going to take Sepal Length, and put that in as a Covariate, right here. And now we have this table, that says that species has a statistically significant effect, it's actually really strong, as does Sepal Length. Now, what we want to do is use a partial Eta squared as a way of looking at the relative contribution of these two. And we see that Species has a partial Eta squared of 0.563. That means that the species can account for fifty-six percent of their variance in the Outcome Seple Width, or on its own. And the Seple Length can account for twenty-eight percent on its own. These don't add up. These are separate considerations. But you can use them to compare them with each other. But we have a lot of other options for things we can do. For instance, depending on how many Variables you have, and if you want to have interactions, you can specify that in the model. And I want to put in an interaction right here, because if you look at this chart, not only do these lines differ in how high they're vertically, which would be their Y-intercept, they also differ in their slope, which is the association between the length and the width. So I want to include that as an interaction. So I'm going to select the both of these, do a shift-click to get both, and as the Add the Interaction. And now, you can see that the Species effect has gone way down, it was much higher before, and the interaction between the two has become important. You also have certain assumptions, like the Homogeneity of variance and like the Q-Q plot of residuals. I'm going to do that one, cause we want the residuals, or the amount of error that's left over after our prediction to be approximately normally distributed. The would all fall on the diagonal, if they were a perfect normal distribution. These are close, so we're not far off. You can specify specific contrast, if you have different groups you want to do, and you can use these. I'm not going to bother with that right now. But maybe you want to do Post Hoc Tests. Now, we only have one factor, and that's Species, but it does have three groups. And so we put that over here, and it's going to do the Tukey comparison by default. And from this, we can see this. Setosa differs significantly from both versicolor and virginica. The P-value here is well below the standard cut-off point 0.05, but the versicolor and virginica have a lot of overlap, and so they're not significantly different from each other. And then finally, we can get Estimated Marginal Means. Now, these aren't going to tell us anything new, because we already have the means for the different groups. But if you had a more complicated design, you could put those in there along with interactions, and get the Means charts for the Factor Predictors. But for a model with one categorical Variable, one nominal Variable, and that's the Species, as well as a single Covariate, which in this case is Seple Length, and then using those jointly to predict the Seple Width in the analysis of covariance, you can see how this can get set up and allow it to do a little more drilling-down to get some more insight from your data. And you can find the patterns are going to be at most theoretical and most practical interest, when doing the ANCOVA in Jamovi.

Contents