[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: ML varlist definition

From   "[iso-8859-7] Λαλούντας Διονύσιος" <>
Subject   st: ML varlist definition
Date   Mon, 3 Mar 2008 08:32:29 +0200 (EET)

Hi to the list,
I try to run the following .do program using ML command:
*** initial estimates ****
cloglog dead drug age logt , nocons
tempname tempname b0 cpr b1 v0
matrix b0=e(b)
matrix v0=e(V)
matrix coleq b0= hazard
matrix cpr= -4
matrix colnames cpr=cure
matrix b1 =b0,cpr

program define spsurv_7
         args todo b lnf
         tempvar t1 t2 sum ST ST_1 ht hT I1 I2 last c
         mleval `I1' = `b', eq(1)
         mleval `I2' = `b', scalar eq(2)
         quietly {

         ge double `c' = 1/(1+exp(-`I2'))
         ge double `ht' = 1-exp(-exp(`I1'))
         by $S_MLE_id: ge double `sum' = exp(sum(ln(1-`ht')))
         by $S_MLE_id: ge double `ST' = `sum'[_N] if _n==N
         by $S_MLE_id: ge double `ST_1' = cond(_N==1,1, cond(_n==_N &
         by $S_MLE_id: ge double `hT' = `ht'[_N] if _n==_N
         by $S_MLE_id: ge byte `last' = 1 if _n==_N

         mlsum `lnf' = cond($ML_y1,(ln(1-`c')+ln(`hT')+ln(`ST_1')), /*
                         */ ln(`c'+(1-`c')*`ST')) if `last'==1

         if `lnf' ==.  {exit}
ml model d0 spsurv_7 ( hazard: dead= drug age logt,nocons) (cure:) ,

and I get the error message r(100) varlist is not defined.
 I supose  that is true because S_MLE_id is not defined . How can solve it
thanks a lot

*   For searches and help try:

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