# Re :st: To generate a correlated Poisson sample

 From Naji To Subject Re :st: To generate a correlated Poisson sample Date Wed, 16 Feb 2005 17:26:11 +0100

```Hi all,

If x1 & x2 are iid Poison (lambda1,lambda2) so, x1+x2 is Poisson
(lambda1+lambda2)
So you can generate 3 independant Poisson variables
X, Y, T with parameter lX, lY & lT
X+T and Y+T is possion and correlation is :
Correlation (X+T,Y+T)=lT/sqrt((lT+lX)*(lT+lY))
you will have to resolve
Final lambda1(known)=lX+lT
Final lambda2(known)=lY+lT
Correlation(known)=lT/sqrt((lT+lX)*(lT+lY))

Best regards
Naji

Le 15/02/05 22:55, « Jhilbe@aol.com » <Jhilbe@aol.com> a écrit :

> In a message dated 2/15/2005 2:34:44 PM US  Mountain Standard Time,
> n.j.cox@durham.ac.uk writes:
>> How can I generate  a correlated Poisson sample in Stata? And the data
>> structure is like the  following:
>>
>> Obs time1 time2 time3 time4
>>  1           2          4         5        2
>>  2           1          3         5        6
>>  3           2          3         1        5
>>  4           0          6         4        1
>> ...
>
>
> One of the  random number generators created by Linde-Zwirble and myself
> about 10 years ago  published in the STB included a Poisson with defined
> correlation. Lookup -rnd-  for details.
>
> Joe Hilbe
>
> *
> *   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/
>

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