Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: censored ordered probit model


From   edoardo masset <edomasset@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: censored ordered probit model
Date   Wed, 30 Jul 2003 11:49:10 -0700 (PDT)

dear Shareen,

I've written this do-file for the estimation of a
censored ordered probit. Many thanks to William Gould
for his help. The file estimates school attainment as
in your case. The likelihood function is a modified
ordered probit function (as in Maddala pag 48) and is
the sum of the LF for the censored and the uncensored
observations. I limited the number of outcomes to 7
because I found some problems in the estimation:
- you might get negative cut-off points, I think these
should be constrained to be larger than zero, though
I've seen published papers with negative cutoffs. But
I dont know how to do this.
- I guess it would work better using initial values
estimated on an ordinary ord probit or on the first
equation of the model. But again I have to find out
how to do this.

 hope this can help
Edoardo


***CENSORED ORDERED PROBIT MODEL*****

/*'att', children attending school are censored
ovbservations.
  The program maxcens maximises a likelihood function
which is the sum of the LF of uncensored and 
  uncensored observations.
  NOTE: convergence is achieved with difficulty
        cut-off values are out of sensible range*/

                                                      
  /*define school attainment dependent variable*/
gen school1 =school==0                    						
/*never been to school*/
gen school2 =school>0 & school<4 								      
/*first half primary*/
gen school3 =school>3 & school<7                      
                          /*second half primary*/
gen school4 =school==7                                
                                         /*jss1*/
gen school5 =school==8                                
                                         /*JSS2*/
gen school6 =school==9                                
                                         /*JSS3*/
gen school7 =school>9                                 
                                   /*all beyond*/

gen unc=att==0                         /*define
uncensored observation: children not attending
school*/
     
cap program drop maxcens 
program define maxcens
	args lnf1  theta1 cut1 cut2 cut3 cut4 cut5 cut6
	qui replace `lnf1' =
unc*(ln(($ML_y1*normprob(`cut1'-`theta1'))+/*
*/                               
($ML_y2*(normprob(`cut2'-`theta1')-normprob(`cut1'
-`theta1')))+ /* 
*/                               
($ML_y3*(normprob(`cut3'-`theta1')-normprob(`cut2'
-`theta1')))+ /* 
*/                               
($ML_y4*(normprob(`cut4'-`theta1')-normprob(`cut3'
-`theta1')))+ /* 
*/                               
($ML_y5*(normprob(`cut5'-`theta1')-normprob(`cut4'
-`theta1')))+ /* 
*/                               
($ML_y6*(normprob(`cut6'-`theta1')-normprob(`cut5'
-`theta1')))+ /* 
*/                               
($ML_y7*(1-normprob(`cut6' -`theta1')))))+ /*
*/				   att*(ln(($ML_y1)+/*
*/                               
($ML_y2*(1-normprob(`cut1'-`theta1')))+ /* 
*/                               
($ML_y3*(1-normprob(`cut2'-`theta1')))+ /* 
*/                               
($ML_y4*(1-normprob(`cut3'-`theta1')))+ /* 
*/                               
($ML_y5*(1-normprob(`cut4'-`theta1')))+ /* 
*/                               
($ML_y6*(1-normprob(`cut5'-`theta1')))+ /* 
*/                               
($ML_y7*(1-normprob(`cut6' -`theta1')))))

end

ml model lf maxcens (school1 school2 school3 school4
school5 school6 school7= rural sex age ,nocons)  /cut1
 /cut2  /cut3  /cut4  /cut5 /cut6  
ml search, repeat(100) 
ml maximize, difficult

log close





__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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