Heckman (Heckman selection model)

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Heckman (Heckman selection model)

Postby EViews Gareth » Wed Apr 07, 2010 3:32 pm

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
Follow us on Twitter @IHSEViews

zetachaox
Posts: 6
Joined: Mon Apr 12, 2010 7:21 pm

Re: Heckman (Heckman selection model)

Postby zetachaox » Mon Apr 12, 2010 8:34 pm

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Heckman (Heckman selection model)

Postby EViews Gareth » Mon Apr 12, 2010 9:19 pm

Could you post the workfile, plus the specification you were using?
Follow us on Twitter @IHSEViews

zetachaox
Posts: 6
Joined: Mon Apr 12, 2010 7:21 pm

Re: Heckman (Heckman selection model)

Postby zetachaox » Mon Apr 12, 2010 10:48 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Heckman (Heckman selection model)

Postby EViews Gareth » Mon Apr 12, 2010 10:56 pm

Can you just attach the workfile to your post here?
Follow us on Twitter @IHSEViews

zetachaox
Posts: 6
Joined: Mon Apr 12, 2010 7:21 pm

Re: Heckman (Heckman selection model)

Postby zetachaox » Mon Apr 12, 2010 11:33 pm

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Heckman (Heckman selection model)

Postby EViews Gareth » Tue Apr 13, 2010 12:09 am

How about just emailing it to support@EViews.com
Follow us on Twitter @IHSEViews

zetachaox
Posts: 6
Joined: Mon Apr 12, 2010 7:21 pm

Re: Heckman (Heckman selection model)

Postby zetachaox » Tue Apr 13, 2010 5:36 am

Alright, i've just emailed the workfile to that address. :)

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Heckman (Heckman selection model)

Postby EViews Gareth » Tue Apr 13, 2010 8:19 am

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.
Follow us on Twitter @IHSEViews

zetachaox
Posts: 6
Joined: Mon Apr 12, 2010 7:21 pm

Re: Heckman (Heckman selection model)

Postby zetachaox » Tue Apr 13, 2010 10:31 am

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?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Heckman (Heckman selection model)

Postby EViews Gareth » Tue Apr 13, 2010 10:45 am

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.
Follow us on Twitter @IHSEViews

zetachaox
Posts: 6
Joined: Mon Apr 12, 2010 7:21 pm

Re: Heckman (Heckman selection model)

Postby zetachaox » Tue Apr 13, 2010 11:48 am

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 :)

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Heckman (Heckman selection model)

Postby EViews Gareth » Tue Apr 13, 2010 12:02 pm

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.
Follow us on Twitter @IHSEViews

troelf
Posts: 3
Joined: Thu Jan 28, 2010 9:03 am

Re: Heckman (Heckman selection model)

Postby troelf » Thu Nov 18, 2010 5:27 am

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!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Heckman (Heckman selection model)

Postby EViews Gareth » Thu Nov 18, 2010 8:41 am

Could you post your workfile?
Follow us on Twitter @IHSEViews


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 18 guests