Statalist


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

AW: Re: st: AW: Question about Heckman Test


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: Re: st: AW: Question about Heckman Test
Date   Wed, 6 May 2009 10:48:13 +0200

<> 

You probably want -normal()- there....

*************
// to replicate millsratio for twostep heckman

cap ssc inst indeplist
cap ssc inst tomata

webuse womenwk, clear
g wageseen=!missing(wage)

probit wageseen married children educ age
indeplist
tomata `r(X)'

mata
	b=st_matrix("e(b)")
	Z=(married, children, education, age, J(2000,1,1))
	millsratio=normalden(Z*b'):/normal(Z*b')
	st_addvar("double","matamills")
	st_store((1,2000),"matamills",millsratio)
end

heckman wage educ age, select(married children educ age) first ns(mills)
nolog two
compare mata mills
*************



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von ??
Gesendet: Mittwoch, 6. Mai 2009 10:44
An: statalist
Betreff: RE: Re: st: AW: Question about Heckman Test

Dear STATA List! 

When I did the probit in Heckman test, the "norm" function did not work in
my STATA. 
Can someone let me know how the norm function as shown below will work?

 probit s age student educat goodhealth
 predict p1, xb
 gen phi=(1/sqrt(2*_pi))*exp(-(p1^2/2))
 gen capphi=norm(p1)
 gen invmills=phi/capphi

Thank you!

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


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



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index