On Sat, 17 Nov 2012, Lee Adkins wrote:
I've encountered the following "feature." restrict is
putting NA into the
standard error rather than 0, making it impossible to retrieve the
estimated standard errors as a matrix (or anything else). Is this as
intended?
? matrix s = $stderr
The statistic you requested is not available
coefficient std. error t-ratio p-value
----------------------------------------------------------
const 11.7952 0.0159611 739.0 0.0000 ***
sqft 0.000000 NA NA NA
sq_sqft 0.000000 0.000000 NA NA
bedrooms 0.000000 0.000000 NA NA
sq_bedrooms 0.000000 0.000000 NA NA
baths 0.000000 0.000000 NA NA
age 0.000000 0.000000 NA NA
It happens with the attached dataset. Since it won't return anything there
is no way to use zeromiss or ok to make it usable.
You're estimating the model subject to a restriction that is
violently at odds with the data (F(6, 1073) = 463) and you're
stressing the numerical apparatus to breaking point.
For comparison, here's the estimation done manually using William
Greene's formulae:
<hansl>
open br.gdt
square sqft bedrooms
logs price
list xlist = const sqft sq_sqft bedrooms sq_bedrooms baths age
matrix R = zeros(6,1)~I(6)
matrix q = { 0 ; 0 ; 0 ; 0; 0; 0 }
ols l_price xlist
matrix b = $coeff
scalar s2 = $sigma^2
matrix X = {xlist}
matrix XXi = inv(X'X)
matrix M = inv(qform(R,XXi))
matrix b_r = b - XXi*R' * M * (R*b - q)
print b_r
matrix Vb_r = s2*(XXi - qform(XXi*R',M))
print Vb_r
matrix se_r = sqrt(diag(Vb_r))
print se_r
</hansl>
Here, the computed variance of the restricted estimator has a
negative diagonal entry, so you get a NaN among the standard errors.
However, maybe we should return the resulting matrix as $stderr,
NaNs and all:
ser (7 x 1)
0.0084454
1.3357e-12
1.0674e-16
-nan
3.6555e-10
0.0000
5.7117e-12
Allin