0:05

Okay. So,

Â we're looking at our study of people using two different keyboards.

Â And they use one or the other.

Â The iPhone keyboard or the Galaxy keyboard in three different postures.

Â And they do all three postures, sitting, standing, and walking,

Â which we fully counterbalanced.

Â We had the parametric analysis, was a mixed factorial ANOVA,

Â because we have a between and within subjects factor.

Â And we saw this interaction plot here, and we found that we have differences at each

Â of the two keyboards and each of the postures were different.

Â How do we do this with a non parametric procedure?

Â Well, let's look at the error rate data.

Â Errors almost invariably do not conform to the assumptions

Â that we discussed for ANOVA.

Â 0:51

They are cut off at zero.

Â They can't sort of be less than zero obviously.

Â They often are kind of random in their distribution.

Â Errors just tend to not

Â sort of allow themselves to be analyzed easily with parametric procedures.

Â So, we can use a non parametric procedure on our error rate column.

Â And we'll do that with an approach called the aligned rank transform procedure.

Â It's important to note that with non parametric analysis,

Â interaction effects are not usually available in the common analysis.

Â Friedman tests that we've looked at, Wilcoxon signed-rank test.

Â Kruskal-Wallis test and Mann-Whitney test, they're all one-way tests.

Â They're just single factor tests.

Â So if we want the possibility of analyzing interactions and handling those the right

Â way, one of the options available to us is called the aligned rank transform.

Â I won't go into great depth about how this works but it does operate on

Â ranks just like the other non parametric tests we've seen.

Â But it operates on something called aligned ranks

Â where the data is aligned before being ranked.

Â And what aligned means is that only the effect of interest is left in the data,

Â because we subtract out values from it.

Â That remove the possibility of other effects.

Â So, for example, if we're just looking at a main effective keyboard, we align

Â the data to that by subtracting out possible estimated effects of posture.

Â If we want to look just at the interaction between keyboard and

Â posture, we subtract out estimated values from each data point

Â that would relate to the main effects of keyboard and posture.

Â So we just leave one effect behind and that's called the alignment process.

Â You're welcome to look that up more online.

Â 2:36

So we'll do our usual approach of exploring the data first.

Â So here we have the different means and

Â medians for the error rates, in the different conditions.

Â And here we have our summary that gives us means and standard deviations of the same.

Â Obviously these are somewhat easier to interpret with a box plot, so

Â we'll work our way there.

Â Let's get a sense first of the shape of the data.

Â And we can see that with the iPhone sitting condition,

Â standing condition, walking condition.

Â And then with the Galaxy sitting, standing, and walking.

Â Very different shapes of the data obviously.

Â A box plug helps us see that it looks, at first glance that while sitting,

Â the errors, these two plots are lower.

Â The error rate's lower, that makes sense.

Â And then when we stand up, the error rate goes up a bit with both keyboards.

Â And then when we're walking, the error rate goes up even more, but

Â seemingly deferentially between the two keyboards, where they stay more the same.

Â So that might suggest we have an interaction effect.

Â 3:52

And here, we have an obviously very interesting result.

Â It looks like when walking, the Galaxy keyboard for

Â whatever reason is more error prone than the iPhone keyboard which

Â obviously would be a very interesting finding.

Â And it's completely fictitious to this example.

Â So, let's go ahead and look at the error rate result.

Â So, we load a library called the ARTool library,

Â and that gives the aligned rank transform.

Â 4:19

And we build a model, as we've done before, using the ART command.

Â We formulate our model like we've seen, where we have our Y on the left.

Â Keyboard by posture is our study, and

Â we add this term in parenthesis one with a vertical bar and subject.

Â This is because the aligned rank transform,

Â the ART procedure under the hood here is using a linear mixed model.

Â We're not going to discuss that right now.

Â That'll be a topic later in the course.

Â But that's what that means and that's what's going on under the hood.

Â This notation is part of what tells it that subject is a random effect.

Â Again, we'll discuss that later, but also helps it know that subject is what to

Â use to correlate data across rows in our table.

Â So, let's go ahead and build that and then we'll report the ANOVA result.

Â Now remember, even though this isn't ANOVA.

Â It is a non parametric result, because the ART procedure used

Â the aligned rank transform on all of the data to build that model.

Â So that's what allows us to see interactions in an F test,

Â is how we'd report this, just like you've seen before,

Â but it's really a non parametric result.

Â Okay, so with this, we see that we have our F statistics for

Â keyboard posture and the interaction.

Â The degrees of freedom in the numerator as you've seen before.

Â And then the residual or denominator degrees of freedom.

Â And we see that all three results are statistically significant.

Â What that means is, for

Â all three main effects in the, or two main effects in the interaction.

Â We have statistically significant results.

Â It seems there's a main effective keyboard, a main effective posture and

Â we can tell from just looking at the graph obviously a significant interaction.

Â We can just for fun here,

Â test the normality of the residuals that the model provides.

Â Remember that one of the ANOVA assumptions is normality and specifically,

Â the normality of the residuals which are the difference and

Â the observations from the model predictions.

Â So we'll use our Shapiroâ€“Wilk test.

Â And even though this is a non parametric test, we're ultimately still doing

Â an ANOVA, and so it would be nice to see that the residuals comply with normality.

Â The Shapiro-Wilk test is non significant, telling us that we don't have

Â a significant departure from normality, so that's nice to see.

Â And we can graph the residuals on a QQ plot as we've done in the past, and

Â see that the data points do seem to fall roughly equal to or

Â random around the normal line.

Â Which is the normal distribution line.

Â So that's good, so it seems that were conforming to the assumptions there

Â of ANOVA which can make us proceed with confidence.

Â So given the overall significant interaction effects and main effects here,

Â we can look a little bit further into pairwise comparisons.

Â Where do the differences lie?

Â One thing we might notice is in the sitting situation and the standing

Â situation, things between the keyboards don't seem to be all that different.

Â But in the walking situation, we see that they are quite different.

Â So that's going to be interesting for us to see.

Â 7:59

are in contrasts where we see the Galaxy and the iPhone comparison.

Â So it's a comparison there.

Â And, we can see that it's a T-test between those.

Â We can also check the pairwise.

Â So we should say with the keyboard, this is equivalent to the main effect

Â because there are only two levels of keyboard.

Â So we just included that kind for completeness.

Â If we want to do the pairwise comparisons among the levels of posture,

Â we can do that.

Â And in the contrast table, we see sitting versus standing, sitting versus walking,

Â and standing versus walking.

Â And they're all significant.

Â So imagine a line drawn between these lines for that posture effect.

Â So it would be kind of moving from sitting to standing,

Â and then going up between them in the middle for walking.

Â Since they're not horizontal, there's clearly effects here of posture overall.

Â 9:01

Now, that approach to contrast testing that we've just done, can't be used for

Â the interaction.

Â So, I have a commented outline here saying, don't do this.

Â Where we'd specify the interaction directly and

Â do a pairwise comparison across factors.

Â The reason we can't do this with the ART approach,

Â the aligned rate transform approach, is that we can't compare

Â pairwise values across factors directly.

Â And that gets to some very deep statistical

Â 9:35

research that we've done looking into that.

Â And you're welcome to look that up.

Â If you look up the vignette, which is an R command for

Â bringing up more information, beyond just the help page.

Â Look up the vignette for ART contrast, you'll be able to read further.

Â The good news is there's another way to do contrast

Â that results in something called interaction contrasts.

Â And it's looking at the difference of differences.

Â And that is usable with the ART approach.

Â And we get that from the FIA library, so we'll load that.

Â There's some notes here explaining how to interpret these things.

Â 10:25

So what we see in this table is not just the usual comparison of levels.

Â We see Galaxy-iPhone on the left and then a colon and then sit-stand,

Â sit-walk and stand-walk on the right.

Â Well, what does that mean?

Â So let's look at our comment here.

Â In the output,

Â A-B colon C-D is interpreted as a difference of differences.

Â In other words, the difference between A and

Â B given C, and the difference of A and B given D.

Â So in other words, is the difference between A and

Â B significantly different in condition C from condition D?

Â So that'd be kind of the general interpretation.

Â So let's apply that here.

Â So we're saying that, is the Galaxy versus the iPhone given the sitting posture,

Â so given the sitting posture of the Galaxy versus the iPhone.

Â Is that difference significantly different from the Galaxy versus

Â the iPhone in the standing situation?

Â So there are difference here.

Â And that is not statistically significant with a chi-squared test.

Â And so, that's saying that the difference we see here,

Â which is obviously very minimal between the keyboards, and

Â the difference we see here which is only slightly bigger.

Â Those differences are really not significantly different.

Â 12:08

So, now we've analyzed this data in two different ways.

Â Let's go ahead and take a look at our analysis table and

Â see where this has brought us.

Â Okay, so

Â we've just completed our analysis of our mobile text entry

Â data with smartphone keyboards, the iPhone keyboard and the Samsung Galaxy keyboard.

Â And also in three different postures, sitting, standing, and walking.

Â So we looked at a factorial ANOVA, in our case, a mixed design with a between and

Â within subjects factor.

Â So let's see the red text in our table here, and

Â notice that its the first time we've had more than one factor.

Â We see that in our left column.

Â We had also, we had factors with more than two levels.

Â So we had a posture within subjects or

Â repeated measures factor that had three levels.

Â Sitting, standing, and walking.

Â 13:05

We had a between subjects factor, and we also had a within subjects factor.

Â So, we have some highlighted analysis in two different rows.

Â We could have a purely between subjects factorial ANOVA,

Â with all between subjects factors.

Â We could also have a purely within subjects ANOVA with all within subjects

Â factors, and the analysis is very much like what we've just carried out.

Â We did a mixed design analysis so we could see how to handle both between and

Â within subjects factors.

Â So for a parametric test,

Â we've covered factorial ANOVAs, and because we had a within subjects factor,

Â we've actually covered factorial repeated measures ANOVAs as well.

Â