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

st: Monte-Carlo simulation of regression models


From   Jenkins S P <[email protected]>
To   [email protected]
Subject   st: Monte-Carlo simulation of regression models
Date   Sun, 18 Jan 2004 11:15:38 +0000 (GMT)

I wish to run some Monte-Carlo simulations of several discrete time
competing risk survival analysis regression models, and have some
questions about how best to handle this using -simulate-.  My intended
programs look something like the following in outline:

~~~~~~~~~~~
create data set containing 'true' explanatory variables (X1-Xk).

-use- this data set

program define mysim
   ... generate depvars YA, YB, and additional 'duration' vbles (D1-Dt),
       from the X1-Xk and uniform()

   ... -ml-based regression #1 of YA, YB, on X1-Xk and D1-Dt (2-eqn model)

   ... -ml-based regression #2

   ... -ml-based regression #3

       [for each model, the main results of interest
       are, for each of the 2 equations, the estimated
       coefficients on the X1-Xk, and their associated standard errors]

   ... return scalar ???
   ... return matrix ???

end

simulate mysim ....
~~~~~~~~~

Questions:

1. What is the most efficient way of returning as saved results all
the estimated coefficients and standard errors? If I define program
mysim as rclass, does this mean that I have to have an -return scalar
<result>- line for each and every one of the coeffs and SEs, or is there a
better way?  [For example, I see that there is a -return matrix- command,
but I am not sure if it can be used in this context, as the matrices
presumably wouldn't accumulate in the simulation data set.]

2. Complication: sometimes the -ml-based regressions may fall over because
of collinearities among the D1-Dt variables. Does one simply trap these
errors in a standard way?  [I think there has been Statalist posting on
this but I couldn't find it in the archive.] And should one change
the number of reps if this happens?

3. What is the -nowarn- option in the example in [R] simulate, p.73?
It doesn't appear to be in the -simulate- syntax diagram on p.69
(though there is a -nocheck- option cited there)


thanks
Stephen
=============================================
Professor Stephen P. Jenkins <[email protected]>
Institute for Social and Economic Research (ISER)
University of Essex, Colchester CO4 3SQ, UK
Phone: +44 1206 873374.  Fax: +44 1206 873151.
http://www.iser.essex.ac.uk
*
*   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