# Regression assumption

I have a data set where $100$ people made $500$ trips for $5$ days. I want to build a trip-level regression (zero-inflated Poisson) where the dependent variable will be the count of hard-braking in each trip and the independent variable will include various trip characteristics, drivers age, gender etc.

I am wondering if I will violate any assumption of the regression as multiple trips of one person will be considered in the sample size ($n=500$).

Multiple observations from the same individual are by definition not independent, so you would be violating the assumption of independence of the observations. Contrarily to what suggested by @ERT I can't think of observations that may be both from the same individual and independent. It seems a contradiction in terms to me. Even if multiple observations from different individuals were to follow distributions with exactly the same parameters, they would still depend from the individual that they are linked to (hence not independent) - individuals that simply happen to have exactly the same personality. Such a scenario is unlikely to emerge in reality but it could be simulated. I agree with @ERT in making driver-ID a categorical explanatory variable, but you should use it to analyse your data in a mixed-effect framework, by fitting driver-ID as a random effect. Yours is a classic example of data that require a mixed-effect model approach, which was developed (also) to analyse data that violate the assumption of independence (examples: repeated measurements on the same individuals, multiple flowers from the same plant, etc). See Pinheiro & Bates's "Mixed-Effects Models in S and S-PLUS" (2000) but also here and here for reference. Pinheiro & Bates's book, as well as this one by Zuur et al. provide further details on non-independent data and how to analyse them in R (including examples similar to your scenario).

For example, in R:

library(lme4)
model1 <- glmer(number.hard.brakes ~ trip.length * driver.age + (1|driver_ID), family=“poisson”, data=YOURDATA)

• I explained that you are not violating assumptions "by using several independent observations from the same individual." I then went on to explain that in order to confirm this, you must check if observations from the same individual really are independent.
– ERT
Commented Jul 25, 2018 at 17:51
• Thank you All. You have been very helpful. How can I check if observations of one driver are independent? Also, can you suggest me a study where each driver's ID was used as a categorical variable? Commented Jul 25, 2018 at 18:54
• @ERT As far as I know, multiple observations from the same individuals are by definition not independent. See my updated answer for further details, references, and examples similar to MSilvy ’s scenario. Can you provide references to back your point and/or make an example of multiple measurements that are both from the same individual and independent from each other? Commented Jul 26, 2018 at 9:48
• @MSilvy see my updated answer for references to examples similar to your scenario. Commented Jul 26, 2018 at 9:49
• An example: I roll a die 10 times. The results are expected to be the same regardless of if you take 10 observations from me or 1 observation from 10 random people. Independence holds because the underlying process is independent. You must determine if the underlying process in this analysis is independent or not. In this case, the observed process is most likely not independent, as I noted in my answer.
– ERT
Commented Jul 26, 2018 at 13:22

Try making driver-ID a categorical independent variable.

This will allow you to run a regression for each individual driver-ID as well as the entire dataset to see how much individual drivers' personalities affect your overall regression outcome. That could be an interesting side-study, and could be somewhat enlightening. You may be able to extend your study to model individual "driver personality/aggression" based on your results...

So no, you are not violating "assumptions" (linearity, multivariate normality, no multicollinearity, no autocorrelation, homoscedasticity) by using several independent observations from the same individual. However, you would like to know if intra-individual observations show some level of autocorrelation. There is a great thread here about diagnosing autocorrelation if you are interested in this type of analysis. Another nice link found here may be helpful in dealing with autocorrelation in your analysis, should you find it exists.

• Including ID as an independent variable doesn't eliminate autocorrelation (i.,e., dependency between observations). Commented Jul 25, 2018 at 16:52
• I generally viewed autocorrelation in time-series terms, with autocorrelation being the similarity between observations as a function of time-lag. This is incorrect?
– ERT
Commented Jul 25, 2018 at 17:05
• There can also be autocorrelation in geographic series (e.g. transects). Autocorrelation is only one type of data non-independence, I would not regard the two terms as synonyms (e.g. piglets from the same mother will provide non-independent, but not autocorrelated measures. In the example provided by @MSilvy, information on trips by the same driver are non-independent but not autocorrelated). Commented Jul 26, 2018 at 10:02