Hi, everybody,
This may be a silly question, but after a while looking for an answer I couldn't find one.
I'm preparing my lecture slides for an undergrad Econometrics course, and I'm trying to show my students what happens to the estimated coefficients when you force a regression with no constant.
As you would expect, the coefficients in the regression without constant are larger than in the regression with constant - but for some reason, the R2 is also larger. Looking at the SS Total, SS Model and SS Residual that are reported with the regression results, you can see that in the regression without constant, the SS Model is three times larger (from 1,015,278 to 3,815,271 ), and the SS Total increases by a large amount too (from 1,372,836 to 4,310,897), and that's why the R2 increases (from 0.73 to 0.88).
But my question is, does anybody know the formula that Stata uses for the SS Model or SS Total, to understand what is going on? The SS Residual is computed by obtaining the residuals from the regression, squaring them, and summing them - but I couldn't replicate the formula used for the SS Model (and I couldn't reverse-engineer it from the standard formula in books like Wooldridge).
Below I'm posting the two regression results, the first one is the model with a constant and the second one is the model without a constant. Naturally, the data is the same in both regressions.
Many thanks for your help,
Pilar
MODEL WITH A CONSTANT
. reg financ ventas numero
Source | SS df MS Number of obs = 150
-------------+------------------------------ F( 2, 147) = 208.70
Model | 1015278 2 507639.001 Prob > F = 0.0000
Residual | 357558.436 147 2432.37031 R-squared = 0.7395
-------------+------------------------------ Adj R-squared = 0.7360
Total | 1372836.44 149 9213.66737 Root MSE = 49.319
------------------------------------------------------------------------------
financ | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ventas | .4669771 .0247413 18.87 0.000 .4180825 .5158717
numero | 1.887674 2.634283 0.72 0.475 -3.318285 7.093632
_cons | 46.78454 6.209729 7.53 0.000 34.51267 59.05641
------------------------------------------------------------------------------
MODEL WITHOUT A CONSTANT
. reg financ ventas numero, nocons
Source | SS df MS Number of obs = 150
-------------+------------------------------ F( 2, 148) = 569.64
Model | 3815271.86 2 1907635.93 Prob > F = 0.0000
Residual | 495625.2 148 3348.81892 R-squared = 0.8850
-------------+------------------------------ Adj R-squared = 0.8835
Total | 4310897.06 150 28739.3137 Root MSE = 57.869
------------------------------------------------------------------------------
financ | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ventas | .5791437 .0231863 24.98 0.000 .5333247 .6249628
numero | 6.373529 3.010972 2.12 0.036 .4234786 12.32358
------------------------------------------------------------------------------
DESCRIPTION OF VARIABLES
. sum financ ventas numero
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
financ | 150 139.9538 95.98785 -38.52245 441.4811
ventas | 150 194.7727 174.3416 0 624.1078
numero | 150 1.173333 1.637426 0 8
This may be a silly question, but after a while looking for an answer I couldn't find one.
I'm preparing my lecture slides for an undergrad Econometrics course, and I'm trying to show my students what happens to the estimated coefficients when you force a regression with no constant.
As you would expect, the coefficients in the regression without constant are larger than in the regression with constant - but for some reason, the R2 is also larger. Looking at the SS Total, SS Model and SS Residual that are reported with the regression results, you can see that in the regression without constant, the SS Model is three times larger (from 1,015,278 to 3,815,271 ), and the SS Total increases by a large amount too (from 1,372,836 to 4,310,897), and that's why the R2 increases (from 0.73 to 0.88).
But my question is, does anybody know the formula that Stata uses for the SS Model or SS Total, to understand what is going on? The SS Residual is computed by obtaining the residuals from the regression, squaring them, and summing them - but I couldn't replicate the formula used for the SS Model (and I couldn't reverse-engineer it from the standard formula in books like Wooldridge).
Below I'm posting the two regression results, the first one is the model with a constant and the second one is the model without a constant. Naturally, the data is the same in both regressions.
Many thanks for your help,
Pilar
MODEL WITH A CONSTANT
. reg financ ventas numero
Source | SS df MS Number of obs = 150
-------------+------------------------------ F( 2, 147) = 208.70
Model | 1015278 2 507639.001 Prob > F = 0.0000
Residual | 357558.436 147 2432.37031 R-squared = 0.7395
-------------+------------------------------ Adj R-squared = 0.7360
Total | 1372836.44 149 9213.66737 Root MSE = 49.319
------------------------------------------------------------------------------
financ | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ventas | .4669771 .0247413 18.87 0.000 .4180825 .5158717
numero | 1.887674 2.634283 0.72 0.475 -3.318285 7.093632
_cons | 46.78454 6.209729 7.53 0.000 34.51267 59.05641
------------------------------------------------------------------------------
MODEL WITHOUT A CONSTANT
. reg financ ventas numero, nocons
Source | SS df MS Number of obs = 150
-------------+------------------------------ F( 2, 148) = 569.64
Model | 3815271.86 2 1907635.93 Prob > F = 0.0000
Residual | 495625.2 148 3348.81892 R-squared = 0.8850
-------------+------------------------------ Adj R-squared = 0.8835
Total | 4310897.06 150 28739.3137 Root MSE = 57.869
------------------------------------------------------------------------------
financ | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ventas | .5791437 .0231863 24.98 0.000 .5333247 .6249628
numero | 6.373529 3.010972 2.12 0.036 .4234786 12.32358
------------------------------------------------------------------------------
DESCRIPTION OF VARIABLES
. sum financ ventas numero
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
financ | 150 139.9538 95.98785 -38.52245 441.4811
ventas | 150 194.7727 174.3416 0 624.1078
numero | 150 1.173333 1.637426 0 8
Comment