Let's consider another important, special case of linear models applied in a pretty general setting. So imagine if our y looks something like this. It's y11 up to y1n / 2. And y21 up to y2 n / 2. So in other words, our y is really equal to two vectors, let's say y1 and y2, where the first comes from one group and the second comes from another group. So we might think of a setting where we're plotting y and we have Group 1, Group 2. Something like a box plot. So some instance like that where you're interested in modelling the fact that there's two groups using least squares. So we could do this with y -, let's say, x beta, minimizing that least squares criteria. Where x is equal to a bunch of 1s and a bunch of 0s, and then a bunch of 0s and a bunch of 1s. So that, and so, x has n over two 1s in the first vector and n over two 1s in the second vector. Now let's work out what beta hat works out to be in this case. So beta hat works out to be exactly equal to of course x transpose x, inverse x transpose y. But x transpose x, okay, so that's just a vector of 1s and 0s. Factor of 0s and 1s times 1s and 0s and 0s and 1s. We want that inverse. Let me get rid of this. And then our next component is x transpose y, which is the vector of 1s and 0s, and 0s then 1s then times y. Okay, so looking at this matrix, this is going to be n / 2 because when I multiply this matrix, this factor times this factor it's going to just add up the number in that first group. When I multiply this factor times this factor, it'll just be 0, same thing for this other diagonal and this one'll be n / 2. And there's nothing in particular about having equal numbers in the two groups, they could've been an n 1 and n 2 there. I just did n / 2 just in the balance case where there's a equal number in both groups. Now let's look at this statement right here. This first one is going to be the sum of the first group so let's just call that Jn / 2 times y1 and the second one is just going to be J transpose n / 2 times y2, okay? And so, and I'm sorry, that's inverted. And the inverse is pretty easy because then it's just a diagonal matrix. So it's just 1 over both of those. And then so what we get is that y1 bar and y2 bar are the slope estimates for beta. Which is what we would imagine should happen if we have an effect 1 for group 1 and a second effect for group 2, the likely estimate would have to have turned out to be the average for group 1 and the average for group 2. So the fitted values in this case is just going to be if you're in group one, it's going to be Jn / 2 times y1 bar if you're in group one. And Jn / 2 times y2 bar if you're in group two.