如果是simple OLS, Stata output已经都提供了. 如下所示。
Total sum of squares (TSS)是total SS, 2676.16216
Residual sum of squares (RSS), 就是output里的Residual SS, 1034.21013
Explained sum of squares (ESS) 是output 里的model SS, 1641.95203.
ESS/TSS 应得R-squared, 所以 1641.95203/2676.16216=0.6135 (正是output里的R-squared)
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 2, 71) = 56.36
Model | 1641.95203 2 820.976017 Prob > F = 0.0000
Residual | 1034.21013 71 14.5663398 R-squared = 0.6135
-------------+------------------------------ Adj R-squared = 0.6027
Total | 2676.16216 73 36.6597556 Root MSE = 3.8166