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, statalist.org is already up and running.

# Re: st: Constrained Regression

 From Nick Cox To statalist@hsphsun2.harvard.edu Subject Re: st: Constrained Regression Date Thu, 11 Aug 2011 16:21:49 +0100

```Your rule still, it seems, is equivalent to using -x1- in your
example. Note that observations with missing -x1- will be omitted from
the regression. (Quite what you mean by "select from 0 and ." is not
clear to me.)

Negatively, there is no way to signal this kind of constraint to
-regress-, or indeed any other kind of model, as it is not a
constraint in the sense of -constraint-. Positively, it does not
matter, as you can just create a variable following your own rule and
use that as a predictor -- and naturally take account of what you have
done in interpretation.

Nick

On Thu, Aug 11, 2011 at 4:09 PM, vikramfinavker
<vikramfinavker@gmail.com> wrote:

> can some one please advise me how can i run a regression which is
> constrained to other variable.
>
> e.g. i am trying to run following regression.
> y = ∝ + βx1+ βx2+βx3+bx5 +ui which is constrained to variable x6
>
> my data for x1 and x6 are like this;
>
> x1              x6
> 123423        1
> 134343        1
> 234234        0
> 555454        1
> 664543        0
> 767677        0
> 0                0
> .                 0
> 0                1
> .                 1
> 12323        0
>
> now i want to tell stata that is should use all observations of x1 where its
> grater than zero (x1>0) and select observations from 0 & missing (.) if x6
> is 0.
>  so i want stata to select following observations
>
> x1              x6
> 123423        1
> 134343        1
> 234234        0
> 555454        1
> 664543        0
> 767677        0
> 0                0
> .                 0
> 12323        0
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```