Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Nick Cox" <n.j.cox@durham.ac.uk> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: how can I pass a parameter to gengammareg? |
Date | Mon, 8 Mar 2010 15:50:05 -0000 |
I don't know precisely what you mean by "manually", but it can't be an answer, as -gengammareg- doesn't know where the values come from. clear set obs 1000 forval s = 1/10 { gengammareg t_`s', s(`s') } works fine, for example. I don't know what r(est) is doing here. -streg- is not r-class. Nick n.j.cox@durham.ac.uk Matteo Richiardi I'm trying to use the gengammareg ado file within the minbound command, but although everything seems working (separately), the program doesn't work. This is what I have written: ******************************** capture program drop simulation program simulation, rclass version 10 args s capture drop t_sim gengammareg t_sim, kappa(1) sigma(`s') // stset the data and fit a Weibull regression model stset t_sim streg, distribution(weibull) scalar s_hat_sim = r(est) return scalar diff = s_hat_sim - .5 end // MINIMIZATION minbound simulation, range(.01 1) trace ******************************** And this is what I get from Stata: failure running quadratic on x = .01 It seems as gengammareg accepts parameters only manually. Any idea on how I can get round of this problem? Thanks so much for support, * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/