Am 19.06.2019 um 01:08 schrieb javier.garcia(a)ehu.es:
3) Furthermore, I think that in this
case the Total Sum of Squares (TSS) based on the weighted data is not
properly calculated, because if we run an OLS regression on the
weighted variables all the statistics depending on the TSS
(R-squared, Adjusted R-squared, F value and its p-value…) are
different (however, the sum of the squared residuals, the S.E. of the
regression, etc. are right). I suspect that Gretl is mixing the
original dependent variable and the weighted results.
Here it would help if you could give a concrete (but ideally very
simple) example, so that we know which numbers you're talking about,
and what you want them to be. (And BTW, have you read command
reference for 'wls'?)
RESPONSE:
Yes, lets use data7-24.gdt
These are the results when we use "pisua" as weight, where "pisua"
is
equal to 1/sqft^2
...
OK, thanks for the example.
AS can be seen, all the statistics depending on the TSS (R-squared,
Adjusted R-squared, F value and its p-value…) are different (however,
the sum of the squared residuals, the S.E. of the regression, etc.
are the same)
I think the arrangement of the statistics after the WLS estimation and
the labeling (weighted/original) is a bit misleading. In fact, it seems
to me that only the SSR and the SE of regr are actually supposed to be
coming from the weighted variant. The R2 (here: 0.7988) is using the
WLS-estimated betas, but then is correctly based on the original data -
because of course you want to compare the fit to the plain OLS on the
original data (which BTW comes out as 0.86 here).
But I agree that the presentation of the results suggests otherwise, and
this should probably be improved. Perhaps we should open a ticket on the
feature request tracker on sourceforge
(
https://sourceforge.net/p/gretl/feature-requests/ -- or the bug tracker
would also work, this is a borderline case I'd say).
thanks
sven