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

st: Weibull MLE, part II


From   <[email protected]>
To   [email protected]
Subject   st: Weibull MLE, part II
Date   Wed, 14 Apr 2004 19:31:01 -0600

Hello All ---
Please pardon the repeated queries about Weibull maximum 
likelihood estimation, but...
About 10 days ago Nick Cox kindly indicated that I was not 
supplying a variable for an argument within my program -- fair 
enough -- and 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.  
I am much obliged!  
Many Thanks...
Clint Thompson

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