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

st: RE: Weibull MLE, part II


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Weibull MLE, part II
Date   Thu, 15 Apr 2004 11:16:35 +0100

As you say, this program looks essentially that in Gould, 
Pitblado and Sribney (p. 57). I can't see any 
typos. I wondered if there would be difficulties 
if `leta' were ever negative in your data, but 
Stata does the right thing with e.g. exp(--2). 
So I am reduced to the old advice 

Say exactly what you typed and exactly what Stata typed 
(or did) in response. N.B. exactly! If you can, reproduce 
the error with one of Stata's provided datasets or a simple 
concocted dataset that you include in your posting. 

Nick 
[email protected] 

[email protected]

> now I am at a loss as to the proper 
> implementation of the Weibull MLE program supplied by Gould, 
> Pitblado, & Scribney when I have a single vector of data 
> (survival time).  The program I'm using is pasted below:
> program weib1
>  	version 8.2
>  	args lnf leta lgam
>  	tempvar p M R
>  	quietly {
>  		gen double `p' = exp(`lgam')
>  		gen double `M' = ($ML_y1*exp(-`leta'))^`p'
>  		gen double `R' = ln($ML_y1)-`leta'
>  		replace `lnf' = -`M'+$ML_y2*(`lgam'-`leta'+(`p'-1)*`R')
> 	}
> end
> 
> This program executes without problem when used on the 'cancer' 
> dataset (with some modification to the variable 'drug' of 
> course) that is accessible from within Stata but terminates in 
> error on my dataset with 'invalid syntax'.  My question is 
> this:  what am I overlooking from a programming perspective?  
> My objective is estimation of theta & beta and -nlcom- will 
> accomplish this, however, I wish to take the scenic route on 
> this one thus my desire to do this with Stata's -ml- commands.  

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index