You may want to check out Mixed Models and Random Effect Models
Note: If you click the corClasses link in the top answer on that StackExchange page, it leads you to a R package "nlme", for "Linear and Nonlinear Mixed Effects Models".
Now look at the description of "Classical Linear Mixed Model" on Mixed Models and Random Effect Models . Here is a screenshot of the formula. For such data, observations are not independent. The model allows modeling the correlation among observations.
peng_liu_0-1660659582096.png