Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Generalized residuals after tobit


From   Fabien Bertho <[email protected]>
To   [email protected]
Subject   st: Generalized residuals after tobit
Date   Wed, 30 Nov 2011 18:32:07 +0100 (CET)

Hello,

I am computing generalized residuals after a tobit regression in order to test for normality and heteroskedasticity.

In the Microeconometrics using Stata handbook (by Cameron and Trivedi) I found an example for left censored models. However, I am running a right censored model.

Does anyone can confirm that I am using right formulas (I have notably doubt about the computation of the threshold)?

Thank you.

Fabien



gen dy= 'depvar'<-.473851     (the upper limit censoring point is -.473851)

tobit 'depvar' 'expvar', ul robust cluster(distance)

predict xb, xb
matrix btobit=e(b)
scalar sigma=btobit[1,e(df_m)+2]
generate threshold=(xb+.473851)/sigma
generate lambda=normalden(threshold)/normal(threshold)

quietly generate uifdyeq1=(ln_mtc_advalorem-xb)/sigma if dy==1
quietly generate double gres1=uifdyeq1
quietly replace gres1=-lambda if dy==0

quietly generate double gres2= uifdyeq1^2-1
replace gres2 =-threshold*lambda if dy==0
quietly generate double gres3= uifdyeq1^3
replace gres3 =-(2+threshold^2)*lambda if dy==0
quietly generate double gres4= uifdyeq1^4-1
replace gres4=-(3*threshold+threshold^3)*lambda if dy==0


--------------------------------------------------------------------------
Tous les courriers électroniques émis depuis la messagerie
de Sciences Po doivent respecter des conditions d'usages.
Pour les consulter rendez-vous sur
http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index