Statalist


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

st: Re: dataset generation


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: Re: dataset generation
Date   Sun, 24 May 2009 12:25:15 +0200

<>

Nikolaos might also like to acquaint himself with the -drawnorm- command:

***
drop _all
drawnorm x y, n(20) means(15 18) /*
*/corr(1, 0 \ 0, 1) sds(4 6) /*
*/cstorage(full) seed(41322)
su
***

Two problems are apparent in his request:

The small sample size makes deviations from his desired values for the mean and standard deviation very likely. If he is willing to increase the sample size, this problem will (almost) vanish.

The reason people recommend the normal distribution for this kind of problem is that you can change the mean and sd to the values you like. Note that for some of the random number functions in -help random_number_functions-, the mean and variance are functions of each other. In the case of the poisson, they are identical, making it harder to make them diverge in the way Nikolaos wants them to....


HTH
Martin
_______________________
----- Original Message ----- From: "Nikolaos Pandis" <[email protected]>
To: <[email protected]>
Sent: Sunday, May 24, 2009 9:15 AM
Subject: st: dataset generation


Hi,

I would like to ask for help in the following:

I would like to generate a small dataset with  2 columns:
column 1: observations 20, mean= 15, sd= 4
column 2: observations 20, mean=18, sd=6

How would I do that?

Many thanks in advance.

Nick



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index