see answer here Statsmodels: calculate set values ββand square R
Rsquared follows a different definition depending on whether a constant exists in the model or not.
Rsquared in a linear model with a constant is a standard definition that uses comparison with the average only of the model as a reference. Total squares reduced.
Rsquared in a linear model without a constant is compared with a model that has no regressors at all, or the constant effect is zero. In this case, the calculation of the squares R uses the total sum of the squares, which do not demean.
Since the definition changes if we add or drop a constant, the square R can go anyway. The actually explained sum of the squares will always increase if we add additional explanatory variables or remain unchanged if the new variable does not contribute anything,
source share