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, statalist.org is already up and running.


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

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


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: how can I pass a parameter to gengammareg
Date   Thu, 11 Mar 2010 12:37:36 -0000

I reinstated the original exchange from 8 March below. Deleting it just
makes this thread much harder to follow. 

Thanks for the context, but my answer is essentially the same. You are
trying to pick up r(est) after you run -streg- but as -streg- is an
e-class command it does not define r(est) and in general r(est) will be
undefined at that point, so you are just passing missings to -minbound-.
So it can do nothing beyond complain, as you saw. 

You don't add any further information on where you think r(est) is
coming from. 

Nick 
n.j.cox@durham.ac.uk 

Matteo Richiardi

thanks for your reply. May be it would help if I better explain what I
intend to do. I'm experiencing with indirect inference estimation
techniques. I have some real data, on which I can estimate a weibull,
that is my auxiliary model. Then, I have a complicated model, that I
cannot manipulate, but I can simulate. I want to estimate the
auxiliary model also on the simulated data coming from the complicated
model, and then change the structural parameters of the complicated
model until the distance between the two sets of estimated
coefficients (of the auxiliary model) is minimized. Since I'm not an
econometric, I wanted to practice by replacing the complicated model
with ... the weibull itself (hence, gengammareg), just to see if I can
recover its (known) parameter. In this sense I have to save the
results of the estimates of the auxiliary model - r(est).
But the procedure does not work. Any suggestion about what I can do
would be really appreciated.

Nick Cox 

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. 

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/


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