How to determine if the occurrence of two events is temporally connected? I'm working on a dataset where I have dates as the main unit of analysis. I'm trying to see if two events are related; that is, if the first event happens, will the second event happen within a month of the first event? 
I have the dates for both, but I'm kind of at a loss for how to proceed. I thought I should be using logistic regression because the variables (outcomes) are binary: either the second event happened within a month of the first event, or it didn't. Should I? How do I make this month-long envelope after the first event? Am I totally on the wrong track?  
 A: I don't think logistic regression is a good option for you as you have described your study question.  You state that your substantive question is:  

if the first event happens, will the second event happen within a month of the first event.  

The probability of the second event happening within a month of the first event can certainly be calculated, and you could run a binomial test, but what is the appropriate probability for your null hypothesis?  You could divide the total number of second events by the total number of months in your observation period, but that still leaves something to be desired.  Moreover, you are throwing a lot of information away by doing this.  (For example, what about second events that occur 32 days after the first event?)  
I think you would be better off using a survival analysis based approach.  You could count the number of days from a given first event until a second event (or the end of your study period).  Then you could get a survival curve, and perhaps a median survival with a confidence interval.  It strikes me as likely to be a lot more useful to know if the median duration is close enough for your purposes.  
A: I think logistic regression is a reasonable approach to answer your question, assuming that a binary question of "did/didn't the event happen within one month" is the right way to think about it. If there are more complicated temporal dynamics involved, then some sort of survival analysis probably more appropriate. 
But there's value in simplicity, and results of the approach you describe will be easy to communicate to a non-technical audience. To do the logistic regression you're talking about, your outcome will be a simple yes/no, and each date will have an associated "precipitating event occurred" value that is also yes/no. So for example
d3 = data.frame(EventOccurred = rep(c(1,0,1),50), 
                OccurredLastMonth = rep(c(1,0,0),50))
head(d3)
m1 <- glm(EventOccurred ~ OccurredLastMonth, data=d3, family=quasipoisson)

Here is a link to an article I published in the American Journal of Public Health that uses a more-or-less similar approach for treating time points as the random variable in your analysis.
