# How to test differences of three categories within the same individuals?

Suppose I can observe $$Y_{ijt}$$, $$i = 1,2,..., n$$ , $$j = 1,2,3$$ and $$t =$$ 3 weeks, 1 months, half a year and one year.

I am interested in whether

1. $$E(Y|j=1,k) = E(Y|j = 2,k)= E(Y|j=3,k)$$
2. $$E(Y|j, k) = \alpha_j + \beta_j k$$

At first, I thought it was a simple question that I can simply use ANOVA for different periods of time in the first case, and for the second I can run simple linear regression at given $$j = 1,2,3$$. Yet I realized that for each individual $$i$$ at given time period $$t = k$$, $$Y_{i1k}$$, $$Y_{i2k}$$ , $$Y_{i3k}$$ are likely correlated, which render ANOVA ineffective. I am what kind of model should I build to tackle these two questions that I want to tackle?

$$E(Y) = \beta_1 + \beta_2 I(j = 2) + \beta_3 I(j = 3) + \beta_4 t + \beta_5 I(j = 2) t + \beta_6 I(j = 3)t$$
• Hi, thx for the suggestion. The covariance not only exists between different time periods but also exists between different levels... for each individuals will have three different $y_{ij}$ corresponding to $j=1,2,3$, I don't think this model will be able to taken into account this unless I was mistaken something?