Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Monte Carlo simulations


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Monte Carlo simulations
Date   Thu, 31 Jul 2008 10:27:30 +0100

Raphael can tinker with means and sds, but that still won't guarantee
that values fall within the range specified. That points up that the
original question is not well-posed without a specification of
distribution. On face of it, it is unlikely to be normal. 

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

tiago.pereira@incor.usp.br

Raphael, try the code below. you can change the standard deviations,
etc.... to get what you want.

*/----------- START-----------------------
clear
set obs 10
drawnorm mean1 mean2 mean3, means(0.09 0.11 0.18 ) sds(0.04 0.1 0.1)
gene id = _n
reshape long mean, i(id) j(group)
drop id
sort group
oneway mean group, scheffe tabulate
*/------------END-------------------------


This code will generate 3 groups with equal size (n=10 - in the example
above). You can create a loop to get a dataset with a specific
characteristics or copy-paste the cole below in  trial-error attempts.

Raphael

I would like to generate three groups of random numbers ranging
between 0.01 and 0.20, where one of the group is statistical
significant from the other groups. Can any one help?


*
*   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