Fitting a distribution to data (e.g. with maximum likelihood), or testing goodness of fit (e.g. with Kolmogorov-Smirnov) assumes that the data are randomly drawn from a population. But what if the data do not satisfy this assumption?
I want to fit a theoretical distribution (log-normal, generalized beta, etc.) to an earnings distribution that comes from administrative data. The earnings distribution is provided as binned data, based on which I can calculate points in the empirical distribution. Specifically, I can calculate $F(X_i)$ where $X_i$ are upper limits of the bins.
But bins are clearly not iid. Does that matter in maximum likelihood fitting, or in goodness of fit testing?
Another question is of sample size. For example, sample size is necessary to calculate Kolmogorov-Smirnov statistic. But what is the sample size in this case, the number of bins, or the population size (because the data is based on the entire population, not only a sample)?