# Regression with dependent observations

Suppose I have the following dataframe:

id    time    sale_yn number  journey_nr  "nVariables with observation specific variables"
abc   10      0      1        1
abc   11      0      2        1
abc   12      1      3        1
abc   13      0      1        2
def   10      0      1        3
def   15      1      2        3
def   16      0      1        4
def   17      0      2        4
def   18      1      3        4


Every row is an observation from a particular person (distinguished by ID). Every person visits a shop a number of times (see number). After some while it is possible that a customer makes a purchase (in that case sale_yn == 1). The regression model needs to take into account the different journeys a customer has made in order to predict whether a sale happens or not. With logistic regression, each observation should be independent of eachother, but the visits that occurred earlier, also contribute to the purchase.

What form of regression can take this into account?