Test for differences in 2 distributions and account for a random effect I have two probability distributions and want to say that they are statistically different. Typically, I would use a K-S test. But, my data comes from multiple individuals, which suggests I have a random effect in the data that needs to be accounted for.  
For example, I have 16 individuals (8 of species A, 8 of species B). I have 100s of dive depths per individual. I have plotted the probability distributions of the dive depths for each species and want to say they are statistically different. Do I need to account for the fact that the dive depths are from different individuals? 
What statistical test is appropriate? 
Thanks!
 A: If your goal is to compare the distributions of depth for these two species then you can forget about the individual factor and just compare to samples of size 800 each. There can be an individual effect, and it can be different among the individuals and between the species, but it will be incorporated into the observed distribution of depth. That happens because when one says "depth distribution for species A" it implies that a particular individual is selected from A and then a measurement of depth is performed for that individual.
There is a technical example that illustrates the same point. Suppose, for argument's sake, that the mean depth for a particular individual is drawn a gamma distribution. In species A, the mean depth $M_A$ is drawn from $\gamma(\alpha_A, \beta_A)$. In species B, the mean depth $M_b$ is drawn from $\gamma(\alpha_B, \beta_B)$. For a particular individual from A with its particular mean $m_A$, the distribution of depth for that individual is Poisson with the mean $m_A$,  $P(m_A)$. 
As a result the distribution of observed depth in species A will be Negative Binomial with the parameters that depend on $(\alpha_A, \beta_A)$. Likewise, the distribution of observed depth in species B will be Negative Binomial with the parameters that depend on $(\alpha_B, \beta_B)$. It's not going to be Poisson or Gamma because it incorporates both the species-to-species and individual-to-individual differences. Therefore, you can compare these two Negative Binomial distributions to each other without thinking about the particular individuals.
