Reputation: 37
I am trying to estimate a system of simultaneous labor supply within couples (called eq1
for women and eq2
for men) with the sureg
command in Stata 14 for Windows.
When I try to add a linear constraint the regression works. However, I need to impose a non-linear constraint on four coefficients but as soon as I add this, I get the following error message:
the constraint caused an error
Below you can find a reproducible example:
sysuse auto.dta
constraint 1 [Eq1]mpg*[Eq2]headroom = [Eq1]headroom*[Eq2]length
sureg (Eq1: price = mpg trunk weight rep78 headroom) ///
(Eq2 : price = headroom length), ///
corr constraint(1)
(note: constraint number 1 caused error r(131))
(note: constraint number 1 caused error r(131))
Seemingly unrelated regression
--------------------------------------------------------------------------
Equation Obs Parms RMSE "R-sq" chi2 P
--------------------------------------------------------------------------
Eq1 69 5 2392.918 0.3150 29.32 0.0000
Eq2 69 2 2581.831 0.2026 18.01 0.0001
--------------------------------------------------------------------------
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
Eq1 |
mpg | -26.58347 29.65312 -0.90 0.370 -84.70252 31.53558
trunk | 31.52432 38.05785 0.83 0.407 -43.06769 106.1163
weight | 1.363126 .3241408 4.21 0.000 .7278219 1.99843
rep78 | 171.411 113.7883 1.51 0.132 -51.60992 394.432
headroom | -377.2506 360.8804 -1.05 0.296 -1084.563 330.062
_cons | 2687.868 1603.852 1.68 0.094 -455.6242 5831.361
-------------+----------------------------------------------------------------
Eq2 |
headroom | -325.9389 402.3103 -0.81 0.418 -1114.453 462.5749
length | 50.51478 12.27884 4.11 0.000 26.4487 74.58087
_cons | -2387.561 2125.435 -1.12 0.261 -6553.338 1778.215
------------------------------------------------------------------------------
Correlation matrix of residuals:
Eq1 Eq2
Eq1 1.0000
Eq2 0.9292 1.0000
Breusch-Pagan test of independence: chi2(1) = 59.574, Pr = 0.0000
When using my real data, I get the same error. This makes it impossible to implement a non-linear constraint in the sureg
estimation, which I really need to impose in my model.
Upvotes: 0
Views: 348
Reputation:
You can re-cast your non-linear constraint as two linear ones and include both in sureg
:
sysuse auto.dta, clear
constraint 1 [Eq1]mpg = [Eq1]headroom
constraint 2 [Eq2]headroom = [Eq2]length
sureg (Eq1: price = mpg trunk weight rep78 headroom) (Eq2: price = headroom length), ///
corr constraint(1 2)
You can then test if the constraint is satisfied as follows:
assert _b[Eq1:mpg] * _b[Eq2:headroom] == _b[Eq1:headroom] * _b[Eq2:length]
Upvotes: 1