# Non-nested, multiple random intercepts to capture unique time effects in a longitudinal study

I am interested in using longitudinal (panel) data on children's academic achievement to understand how achievement varies as a function of how long a child has been in school. Imagine that I have achievement data measured up to 6 different times for each child.

## Growth Curve Model

One common model in my field of educational research would be the following, in which I treat time as a continuous variable:

growth <- lmer(ach ~ time + (time|child), df)

This would provide information on the variation in the linear rate of change in children's achievement over time. But this is not exactly what I want to know.

## Non-nested Model

I'd like to know whether there are systematic achievement effects that are unique to each year in school. Thus, I am more interested in the following non-nested (or cross-classified) model, in which I treat time as a random factor:

uniquetime <- lmer(ach ~ 1 + (1|time) + (1|child), df)

I would also like to know whether these systematic effects vary depending on stable, child-level characteristics. For example, do low income children exhibit the same pattern of time effects on achievement. I am not quite sure how to model this, however. One thought would be this model:

uniquetime2 <- lmer(ach ~ 1 + income + (income|time) + (1|child), df)

Does this model make sense to other people? Do you have other suggestions about how I might model or test variation in the time effect on achievement based on child characteristics?

### Alternative, less desirable approach

I realize that I could remove time as a random factor and include it as a fixed factor and interact it with income as such:

fixedtime <- lmer(ach ~ 1 + income*time + (1|child), df)

But I would ideally like to treat time as random for a variety of reasons. Not the least of which is that I want to use partial pooling to predict the time effect with associated uncertainty intervals.

Some points on the different models:

• Model growth is indeed a typical model used for longitudinal data. In your example it will assume that academic achievement measurements from the same child are correlated. Moreover, including the random slope for time says that the correlations between academic achievement measurements decay with the time lag. That is, the correlation between time 1 and time 2 will be stronger than the correlation between time 1 and time 6. You could include additional higher order random slopes terms to model the correlations over time more flexibly, e.g., ach ~ time + (poly(time, 2) | child). If you take this to the extreme, you could treat the time variable as factor. In this case, you would assume a completely unstructured variance-covariance matrix for the six measurements (though you would need to carefully specify this model because in this case you cannot also include error terms and estimate an additional variance parameter).
• Model uniquetime1 specifies that academic achievement measurements from the same child are correlated, and that academic achievement measurements from the same time point but different children are correlated. It is not clear from your description why the latter would be the case. One situation which would satisfy this assumption is if the academic achievement of children at the same time point was assessed with the same procedure/test. But if children are assessed differently on the same time point, then there should be some other plausible reasons why you want assume that measurements from the same time point but from different children are correlated (i.e., that the children share something common at the same time point).
• Model uniquetime2 additionally contains the random slope for income for the time grouping variable. The interpretation of this random slope will be along the same line as in the growth model. That is, academic achievement measurements at the same time point from children from families with similar income will be stronger correlated than measurements from children from families with different incomes.
• Thanks, Dimitris! Thinking about uniquetime2, could one also interpret (income|time) as a potential test of whether the time effect differs for low income vs. non-low income children? Perhaps by a likelihood ratio test of the two models - anova(uniquetime1, uniquetime2). Or would you suggest a different specification for the random effect to test this possibility? – Erik Ruzek Feb 8 at 17:56
• As an example, I could have a random structure such as (1|time:income), that gives each combination of time and income its own intercept. @RobertLong has a nice explanation of this approach in his response to a prior question. stats.stackexchange.com/questions/232109/… – Erik Ruzek Feb 8 at 20:25
• @ErikRuzek is income categorical or continuous? In the latter case do you have enough replications in each unique time:income combination to stably estimate the variance? – Dimitris Rizopoulos Feb 8 at 20:45
• It will likely come to us as continuous @DimitrisRizopoulos, but we could easily categorize it into groups that are meaningful from a policy perspective (e.g., very far below the poverty threshold, just at or below the poverty threshold, just above, and very far above; or eligible to receive free lunch at school or not eligible to receive free lunch). These groups would have not equal, but certainly sizable representation in each. – Erik Ruzek Feb 8 at 20:52
• I guess my main concern with this approach is that if I have multiple groups of interest (e.g., income, but also race and language minority status), I don't think it makes sense to create all possible categories of these as a random intercept (i.e., time:income:race:langstatus). I am more interested in the time by group differences (i.e., each of time:lowincome, time:race, and time:langstatus). Does it make sense to have all of these in the same model or estimate separate models for each? – Erik Ruzek Feb 10 at 19:55