Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: creating observations of non-occurrences


From   "Frederick Guy" <f.guy@bbk.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: creating observations of non-occurrences
Date   Wed, 19 May 2010 15:31:52 +0100

I have N observations, each of which records a transaction between an
agent of type A and an agent of type B. 

I want to create a dataset of 11*N observations: the N that I already
have, plus 10*N for AB pairs that did not transact.

More specifically, for each transaction AiBj, i = 1....N, j= 1....T, I
want to draw a random sample of 10 AiBk non-occurrences, from the T-1
cases of k != j.

As usual I expect that this is laughingly simple, but these loops are
new to me.

Thanks.

Frederick



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