Page 1 of 2

Heckman (Heckman selection model)

Posted: Wed Apr 07, 2010 3:32 pm
by EViews Gareth
This thread is about the Heckman Add-in that perform the Heckman selection model.

Change Log
  • 2010/04/07 - Initial release
  • 2010/04/13 - Fix display bug whereby the value of Rho was being reported for Sigma, and vice versa. Also made it slightly faster.
  • 2010/11/19 - Fix a bug that would cause errors to occur if the data contained internal NAs

Re: Heckman (Heckman selection model)

Posted: Mon Apr 12, 2010 8:34 pm
by zetachaox
Hello there. This is my first time posting in this board, so i apologize if I've missed anything. I've been trying to use the heckman selection for a labor supply model, but whenever i try to run the model, i get an error message saying that the dependent variable does not have a variance.

I don't know if this is related, but the sample I'm using has no labor supply data for people under 16, and its labeled NA instead of 0, however, I've specified the sample selection to be age>16 and age<65 so i don't think this should be a problem.

Re: Heckman (Heckman selection model)

Posted: Mon Apr 12, 2010 9:19 pm
by EViews Gareth
Could you post the workfile, plus the specification you were using?

Re: Heckman (Heckman selection model)

Posted: Mon Apr 12, 2010 10:48 pm
by zetachaox
For the wages, i was using
incwage c age sex escuela education

for the labor supply
yrworkhrs c incwage notwageinc spouseinc age sex famsize-nchild escuela education disability

I believe this is the order it goes. But to be honest I'm not sure I'm doing it the right way, i like to practice things as i learn them. From what i see, it helps me understand them better

Here's the workfile:
http://www.2shared.com/file/12560970/95d25a99/workfilemicro2.html

Re: Heckman (Heckman selection model)

Posted: Mon Apr 12, 2010 10:56 pm
by EViews Gareth
Can you just attach the workfile to your post here?

Re: Heckman (Heckman selection model)

Posted: Mon Apr 12, 2010 11:33 pm
by zetachaox
Sorry, it was uploading for the past half hour and i didnt seem to get any results.

Is there a problem with 2shared? I can try uploading it somewhere else if you want.

Re: Heckman (Heckman selection model)

Posted: Tue Apr 13, 2010 12:09 am
by EViews Gareth
How about just emailing it to support@EViews.com

Re: Heckman (Heckman selection model)

Posted: Tue Apr 13, 2010 5:36 am
by zetachaox
Alright, i've just emailed the workfile to that address. :)

Re: Heckman (Heckman selection model)

Posted: Tue Apr 13, 2010 8:19 am
by EViews Gareth
Got it.

The selection equation is expecting a dependent variable (incwage in your case) that is binary, i.e. 1 or 0.

I believe if you create a variable that is equal to a 1 whenever incwage is greater than 0, and 0 otherwise, then use that as your dependent variable, it will work.

Re: Heckman (Heckman selection model)

Posted: Tue Apr 13, 2010 10:31 am
by zetachaox
Alright, thanks a lot. :)

I've gotten the program to work using a dummy variable for labor market participation, and the program seems to work fine using two-step mode.

However when i try to use Maximum Likelihood mode, i get an error message saying "Missing Values in @LOGL series at current coefficients at observation 1", Is there something i need to do in order to use to use ML mode?

Another question is that, since in the end the program shows me a spool, as opposed to an equation, i was wondering how would i analyze and run tests regarding the goodness of fit of the model?

Re: Heckman (Heckman selection model)

Posted: Tue Apr 13, 2010 10:45 am
by EViews Gareth
The LOGL error just means that the maximum likelihood estimation had problems converging.

I'll make a note to add user starting values, rather than using the two-step as starting values. That might make it work a bit better.

With regards to the second question, that's just a limitation of an EViews Add-in. It isn't a build-in routine, so there is no support for the standard EViews concepts of object persistence etc...

For any testing, etc..., to be done, someone would have to add those tests to the Add-in.

Re: Heckman (Heckman selection model)

Posted: Tue Apr 13, 2010 11:48 am
by zetachaox
What does the fact that ML had problems converging imply? specification error? problems with the sample?

As for the add-in limitations, i understand now. This is my first time working with an add-in, so i don't know a lot about them.

I would like to thank you for your effort and your timely responses :)

Re: Heckman (Heckman selection model)

Posted: Tue Apr 13, 2010 12:02 pm
by EViews Gareth
The Heckman selection ML estimator is known for being quite tricky to get to converge - I believe that is why most people still use the two-step method. The fact that it doesn't converge for your model doesn't necessarily say anything about your particular model/data, just that the ML estimator, and my implementation of it, is not that great.

Re: Heckman (Heckman selection model)

Posted: Thu Nov 18, 2010 5:27 am
by troelf
Hello there. I am using Eviews 7.1

I tried to find a solution to my problem in the documentation but couldn't find anything. Maybe it's too basic, so i apologize if I've missed anything. The error message which pops up when estimating a two-step heckman model is: sizes do not match in matrix function

Any suggestions what to do about this?

Thanks a lot in advance!

Re: Heckman (Heckman selection model)

Posted: Thu Nov 18, 2010 8:41 am
by EViews Gareth
Could you post your workfile?