How do we find information about the distribution of a variable in presence of dependency among our observations? This dependency is coming from measuring the variable on the same group of subjects multiple times.
These are two examples of what I have in mind:
Suppose we have a website for customers to purchase goods. We are interested in the distribution of the amount of time the customers spend on this site per visit. A customer might come back to the site many times. These visits are considered distinct observations. A customer's second visit might be because of an earlier promotion that they saw on the site. Therefore, our observations are not i.i.d. (or a simple random sample).
In a clinical trial, where, say, blood glucose levels are measured for subjects in 3 minute intervals and we're interested in their "typical value" in the 20 minute interval after exercise. Again, the values are dependent for each subject.
My naive answer is to reduce all observations from the same subject to one value, and to look at the distribution of these values, but I'm certain there's a better way to do this.
Update: After reading the responses from @PeterFlom and @NickCox, I realized that my question was somewhat vague and I needed to add some more detail.
Let's assume that I'd like to find the mean of this distribution. The weak law of large numbers requires i.i.d. variables (probably there is a more general version, say for exchangeable variables, but that's still not a valid condition in the situations I mentioned above.) How does one go about finding "average time a user spends on the website per visit"?
I welcome any suggestions, but I'm most interested in answers that have some theoretical justification.
Update 2:
This is the mathematical formulation of my question. Hopefully, it'll clarify the ambiguities in the wording:
Suppose for $N$ subjects, we've made observations:
- For subject 1, $X_{1,1},\ldots,X_{1,i_1}$.
- For subject 2, $X_{2,1},\ldots,X_{2,i_2}$.
- ...
- For subject N, $X_{N,1},\ldots,X{N,i_N}$.
(So, the number of observations for different subjects is not the same.) All the $X_{i,j}$ have the same distribution, but they are not necessarily independent.
My question is, if my goal is to estimate $E(X_{i,j})$, what would be the best estimator? I don't believe the answer $$\frac{\sum_{i,j}X_{i,j}}{i_1+\cdots+i_N}$$ is correct, because the law of large numbers doesn't apply here.
My answer is $$\frac{\sum_i\frac{\sum_j X_{i,j}}{i_j}}{N}$$ but as I mentioned earlier, I feel there must be something better.