Statalist


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

Re: Fwd: st: AW: RE: AW: Simulation in Stata


From   "Susan Olivia" <olivia@primal.ucdavis.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: Fwd: st: AW: RE: AW: Simulation in Stata
Date   Thu, 28 May 2009 06:00:10 -0700

Thanks Nick and Martin for the advice. 

The reason I convert the variables into matrices in my code
is that the dependent variable is a spatially autocorrelated
generated variable for a predetermined weighting matrix). I
can't think of easier way other than converting these into
matrices.

Thanks Martin for pointing out the possibility to use
'simul'. Will give it ago. 

Susan



> ---------- Forwarded message ----------
> From: Martin Weiss <martin.weiss1@gmx.de>
> Date: Thu, May 28, 2009 at 5:48 AM
> Subject: st: AW: RE: AW: Simulation in Stata
> To: statalist@hsphsun2.harvard.edu
> 
> 
> 
> <>
> 
> Probably true, in the absence of a declaration to the
> contrary from her... I did not seet through the code to
> arrive at this intention...
> 
> 
> HTH
> Martin
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag
> von Nick Cox Gesendet: Donnerstag, 28. Mai 2009 12:32
> An: statalist@hsphsun2.harvard.edu
> Betreff: st: RE: AW: Simulation in Stata
> 
> My comment is a bit different. What Susan apparently user
> wants can be achieved by
> 
> expand 10
> sort id_psu, stable
> gen no = _n
> 
> In short, the -stable- option of -sort- is intended for
> this purpose.
> 
> In a big dataset, that last should be
> 
> gen long no = _n
> 
> Nick
> n.j.cox@durham.ac.uk
> 
> Martin Weiss
> 
> [...]
> 
> *************
> expand 10
> gen no = _n
> 
> sort id_psu no
> drop no
> gen no = _n
> *************
> 
> is too complicated as you first have Stata record the
> current sort order via
> "_n" , then -sort- on "id_psu" and then -drop- "no" - only
> to recreate it in
> the next step.
> 
> [...]
> 
> 
> *
> *   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/
> 
> 
> *
> *   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/
> 

*
*   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   |   What's new   |   Site index