Decomposition of Total Sums of Squares