首先,每次回归之后,输出结果的左上角都有会显示三种sum of squares及所对应的degrees of freedom
Stata的document说,“The total sume of squares, TSS, equals y'y if there is no intercept and y'y- {(1'y )^2/n} otherwise. ”其中第一种是不demeaned,而后一种是demeaned sum of squares、也就是平常定义的方差的分子部分。
但是Greene的书说,“Variation of the dependent variable is defined in terms of deviations from its mean, (y_i-y_bar). The total variation in y is the sume of squared deviations.” 也就是说,Greene定义的TSS从来没有不加常数项就不demean的说法,这跟Stata是截然相反的。
我做一个dummy variable 的pooled regression,如果想把所有的dummy都放到回归方程里,就必须舍弃常数项,但结果得到的TSS是186535.954,而Residual sum of squares(RSS) 是82.2673214, 导致R squres 高的离谱,是0.9996;如果加入一个常数项而舍弃一个dummy,那么TSS是886.904902,RSS不变,所以R squares是0.9072,这个应该是比较正确的。
那为什么Stata在没有常数项的时候,计算TSS会不同呢?因为这个问题涉及到相关统计量的计算,所以很重要!
求大虾帮助!