Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: how can I pass a parameter to gengammareg?

From   "Nick Cox" <>
To   <>
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. 

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. 


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

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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index