Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Table to count how many times an event occurs with another


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Table to count how many times an event occurs with another
Date   Thu, 4 Aug 2011 17:37:01 +0100

See also -groups- from SSC.

On 4 Aug 2011, at 16:39, Katia Bobulova <[email protected]> wrote:

No unfortunately it is not what I want.

I am just trying to have a table showing how many times a dummy is
released contemporaneously to each other dummy for each interval time
through my sample.

Thank you very much anyway.

Katia


2011/8/4 MacLennan, Graeme <[email protected]>:
If you have only four dummies then:

*** example begin***
gen d1d2d3d4 =  D1*1000 + D2*100 + D3*10 + D4
tab d1d2d3d4
*** example end***

Might do what you want?
Graeme

********
This is an example of my databse:

Date              Time      D1 D2 D3 D4
01/01/2008     8:00       1   0    0   1
01/01/2008     9:00       0   0    0   0
01/01/2008    10:00      0   1    1   0
.....               .......       .    .     .   .

For every day I have something similar to the above example with dummy variables. In the fist row (8:30) I have that two dummies happen at the same time and also in the last row (10:00). I want to construct a table, in which I have the number of times ( for each interval throughout my whole sample) I have that events D1 and D4 happen together and D2 and D3 happen together and so on for all





















*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index