# Logistic regression across groups

When running a logit/probit model for particular sets of outcomes on a set of participants (whether they did a certain behavior at least two times), how can one best control for differences when the individual observations began? In particular, one person may have started to participate 3 years ago, whereas another person may have joined just last year. I'm using STATA for the analysis and do know when the individuals began observations. Related to this question, what is the most effective way to refine the functional form of a the model?

• Can you describe the context a bit? In a generic data analysis problem, it's not obvious that time since enrollment (for lack of a better term) will be a relevant factor - how is it relevant to these data? Jun 22, 2012 at 12:47
• I'm guessing that you are running some intervention that takes place over time, so some people have more time in the program than others. If so, you could just include time in program as an independent variable Jun 22, 2012 at 13:08
• Sure. As Peter says if time since enrollment is an important factor it should show up as such in the model. Jun 22, 2012 at 13:26
• In addition to including subject's duration in program, you might consider including a measure of when the subject participated. For example, a subject participating in the program for one year in 2006 may make more purchases than a subject participating in the program for one year in 2009 due to differences in local or global economic conditions. Jun 22, 2012 at 16:09
• Could you clarify your description of model and outcome? You state in the question that you have a logit or probit model, which models binary outcomes. Yet in your comment, you describe your outcome as "cumulative purchases over time" which to me sounds like count data. Jun 22, 2012 at 16:14

As I understand your question, you have a cohort study where participants were followed up for a variable period of time. You are interested in the association of unspecified exposures with an outcome. The outcome is cumulative number of purchases made by participants. Your concern is that some participants will have higher outcomes simply because they participated in the study for a longer period of time than other participants.

Poisson regression

I would consider modeling your data with Poisson regression. Poisson regression is typicaly used when the outcome variable is count data with a Poisson distribution.

For a brief background on why count data is modelled with Poisson regression, see this discussion on CrossValidated.

Important assumption: An important assumption of Poisson regression is that the mean of the outcome is equal to the variance of the outcome. When this is not the case, related regression models such as the quasi-binomial or the negative binomial may be better. Also, sometimes outcome data may have many observations with a value of 0 (e.g. many participants made no purchases), which would not be predicted by a Poisson distribution. The negative-binomial, hurdle, and zero-inflated models may be better in that case. A recent overview of overdispersion and excess zeroes in Poisson models (albeit with a focus on the R language) is Regression Models for Count Data in R by Achim Zeileis and colleagues.

UCLA's Advanced Technology Services website offers some good examples of Poisson regression in Stata.

Accounting for time

Regarding your specific question about including time in your analysis, a nice feature of Poisson regression is that you can include an offset. The offset in your data would be a measurement of your participants' duration in the program. For example, if the first three subjects participated for 20, 10, and 30 days, the offset would be "log(20, 10, 30)". The offset allows your outcome to be modelled as a rate (the probability of purchase per unit time). This CrossValidated discussion on offsets offers a concise summary.

Additionally, you might consider whether time trends could effect your outcome. For example, perhaps participants participating in earlier years were more likely to make purchases than participants participating in later years. Perhaps participants participating in the winter were more likely to make purchases than participants participating in the summer.

• +1, this is a really nice overview of Poisson reg, which I agree is the right approach here. One thing to note is that dichotomizing data leads to information loss & all that that entails, whereas you can figure out whether someone make >2 purchases from the Poisson output. Jun 23, 2012 at 14:37