Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Introducing constraints to biprobit model

From   Huybregts <>
Subject   Re: st: Introducing constraints to biprobit model
Date   Tue, 28 Aug 2012 11:29:08 +0200

Many thanks for the reply and the coding Maarten, however if I run the model with constraints, I get the error message: 
(note: constraint number 1 caused error r(111))  ( no variables defined;)
(note: constraint number 2 caused error r(111))

It does not seem to accept the constraints, but runs the full model nevertheless. Can I assume for this that since the constraints entail coefficients from both models, when stata runs model 1 and model 2 separately it cannot apply the constraints because they are not known yet (seems logic enough). Just to be sure.


On Aug 28, 2012, at 11:05 AM, Maarten Buis wrote:

> sysuse auto.dta,clear
> egen cat=cut(rep78),grou(2) label
> // model without constraints
> biprobit (cat mpg price)      ///
>         (foreign mpg price)
> estimates store R1
> // replay the model, but see the coefficient names:
> biprobit, coeflegend
> // use those name to define the constraints
> constraint define 1  _b[cat:mpg]   =  _b[foreign:mpg]
> constraint define 2  _b[cat:price] =  _b[foreign:price]
> // Model with constraints
> biprobit (cat mpg price) ///
>         (foreign mpg price), constraint (1 2)
> estimates store R2
> lrtest R1 R2

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index