# st: Re: Stata Heckman and Mills ratio

 From Christopher Baum To seb nieto Subject st: Re: Stata Heckman and Mills ratio Date Thu, 24 Sep 2009 15:24:25 -0400

No. Those two equations are not comparable. You have to include the same regressors in heckman, as in this example:
```
webuse womenwk,clear
reg wage education age married
```
heckman wage education age married, select(married children age education) ///
``` twostep mills(lambda)
reg wage education age married lambda

```
The last regression then matches the heckman results (with small- sample standard errors, but otherwise identical). If you believe that the selection variable should be included in the model, it should be included in the heckman regression equation as well to be comparable.
```

Kit Baum   |   Boston College Economics and DIW Berlin   |   http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming   |   http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata   |   http://www.stata-press.com/books/imeus.html

On Sep 24, 2009, at 1:35 PM, seb nieto wrote:

```
```Thank you very much for your quick answer.

```
Can I however use the equation 3 (below) as an estimation that incorporates the lambda?
```
Sebastian

--- On Thu, 9/24/09, Christopher Baum <baum@bc.edu> wrote:

From: Christopher Baum <baum@bc.edu>
Subject: Re: Stata Heckman and Mills ratio
To: "seb nieto" <nietoseb@yahoo.com>
Cc: statalist@hsphsun2.harvard.edu
Date: Thursday, September 24, 2009, 1:10 PM

Seb,

```
you can always create an r^2 measure from the squared correlation of actual and predicted observations used in the estimation. So something like
```
reg y...

heckman y...
predict double heckp if e(sample), xb
corr heckp y
di r(rho)^2

which should be comparable to the r^2 displayed from the regress.

Kit Baum   |   Boston College Economics and DIW Berlin   |   http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming   |   http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata   |   http://www.stata-press.com/books/imeus.html

On Sep 24, 2009, at 12:50 PM, seb nieto wrote:

> Dear Kit,
>
```
> I am running a regression in which one of the explanatory variables could have a "selection bias".
```> The basic equation is
> reg y x1 x2 x3 x4     (equation 1)
>
```
> However x2 has a selection bias problem that can affect the result of equation 1
```>
> I then run the following regression:
```
> heckman y x1 x3 x4, select(x2 = Z1) twostep mills(lambda) (equation 2) > in which Z1 are a set of explanatory variables (some of them different than x1, x3 and x4).
```>
```
> I would like however compare the R2 of the equation (1) with respect to equation (2). Can I then run the following regression and report the results of equation (3) instead of those of equation (2)?:
```>
> reg y x1  x3 x4  lambda   (equation 3)
>
```
> Of course, lambda variable of eqaution 3 is estimated from equation 2.
```>
> Thank you very much for your help.
>
>

```
```
*
*   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/
```