I'm trying to show that matrix. $ mathbf {(H- frac {1} {n} J_n)} $ It is idempotent where $ mathbf {H} $ It is the matrix of the linear regression hat and $ J_n $ is the $ n times n $ matrix with $ 1 $ In all your entries. Taking :

$$ mathbf {(H- frac {1} {n} J_n) (H- frac {1} {n} J_n) = HH – H frac {1} {n} J_n – frac {1} {n} J_nH + frac {1} {n} J_n frac {1} {n} J_n} $$

Now we know that $ mathbf {H} $ Y $ mathbf { frac {1} {n} J_n} $ They are identity content, therefore:

$$ mathbf {(H- frac {1} {n} J_n) (H- frac {1} {n} J_n) = HH frac {1} {n} J_n – frac {1} {n } J_nH + frac {1} {n ^ 2} J_n} $$

How would you continue now to show that the given matrix is an identity content?