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


/*'att', children attending school are censored
  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                                
gen school5 =school==8                                
gen school6 =school==9                                
gen school7 =school>9                                 
                                   /*all beyond*/

gen unc=att==0                         /*define
uncensored observation: children not attending
cap program drop maxcens 
program define maxcens
	args lnf1  theta1 cut1 cut2 cut3 cut4 cut5 cut6
	qui replace `lnf1' =
-`theta1')))+ /* 
-`theta1')))+ /* 
-`theta1')))+ /* 
-`theta1')))+ /* 
-`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')))))


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
*   For searches and help try:

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