On Tue, 18 Jun 2019, javier.garcia(a)ehu.es wrote
(in response to Sven's request for a specific example, and a propos
the auxiliary statistics reported by gretl following weighted least
squares estimation via the "wls" command)
Yes, lets use data7-24.gdt
These are the results when we use "pisua" as weight, where "pisua"
is equal to 1/sqft^2
Model 1: WLS, using observations 1-224
Dependent variable: salepric
Variable used as weight: pisua
coefficient std. error t-ratio p-value
----------------------------------------------------------
const −285.205 37.2121 −7.664 5.70e-013 ***
sqft 0.215569 0.00959143 22.48 6.74e-059 ***
age −0.549288 2.28001 −0.2409 0.8098
city 110.780 15.6896 7.061 2.14e-011 ***
Statistics based on the weighted data:
Sum squared resid 0.150742 S.E. of regression 0.026176
R-squared 0.798817 Adjusted R-squared 0.796073
F(3, 220) 291.1769 P-value(F) 2.64e-76
Log-likelihood 500.1866 Akaike criterion −992.3732
Schwarz criterion −978.7266 Hannan-Quinn −986.8648
Statistics based on the original data:
Mean dependent var 642.9294 S.D. dependent var 371.3762
Sum squared resid 4735143 S.E. of regression 146.7085
And these are the results when I build the transformed variables
(variable_n=variable*sqrt(pisua)) and apply OLS in the transformed
model:
Model 2: OLS, using observations 1-224
Dependent variable: salepric_n
coefficient std. error t-ratio p-value
----------------------------------------------------------
const_n −285.205 37.2121 −7.664 5.70e-013 ***
sqft_n 0.215569 0.00959143 22.48 6.74e-059 ***
age_n −0.549288 2.28001 −0.2409 0.8098
city_n 110.780 15.6896 7.061 2.14e-011 ***
Mean dependent var 0.153250 S.D. dependent var 0.034928
Sum squared resid 0.150742 S.E. of regression 0.026176
R-squared 0.445905 Adjusted R-squared 0.438349
F(3, 220) 59.01455 P-value(F) 4.97e-28
Log-likelihood 500.1866 Akaike criterion −992.3732
Schwarz criterion −978.7266 Hannan-Quinn −986.8648
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)
This is explained in the documentation for the "wls" command. We do
the same thing as R, namely replace the regular TSS with the weighted
TSS, that is, the sum of squared residuals from a regression of the
weighted dependent variable on the weighted constant alone.
Allin