$X$ is an $n×p$ matrix, with $Rank(X)=r$. Then what is the Rank of the matrix $P=X(X^TX)^{-1}X'$? Is it always true that $Rank(X)= Rank(P)$? Is it true when $X$ is of full column rank, i.e. $p=r$?
I know that $Rank(X)=Rank(X'X)$, but I am confused with the above questions. Any help will be appreciated. Thanks in advance.