Thanks for the previous feedback. Initially, I was trying to say that the predictions from using fitted() seemed to be off by quite a bit. However, when I just plugged in the various values that were found using fixef() and ranef(), I obtained different and better results.

 

But now I would just like to ask a modeling question. Please keep in mind this is the first time I am using this library.

 

I have school level data from 2002-2009. The quantities of interest are as follows.

 

API - the response variable. Each school receives an API score each year

AVGED - this is the main predictor. Each school receives an average parental education score each year 

Years - 2002:2009

CDS - Each school has a unique ID number called the CDS

 

I am interested in the performance of a particular school, AHS. Based on taking separate standard lm() regressions each year (and other information), I believe that AHS did better than predicted in the early years but has done worse and worse in subsequent years and is now doing much worse than predicted.

 

For my sample, the mean score increased steadily and was up close to 100 points during the time frame. The schools that started low had somewhat bigger gains than those that started high. The sd for each year's API declined about 15% from start to finish. AVGED scores declined slightly.

 

Given its AVGED, how did AHS do each year compared to expectations?

 

I am trying to come up with a mixed effects model that will show that the answer is worse and worse.

 

I came up with two models that produce predicted values in line with my expectations. They were:

 

model5b = lmer(API ~ 1 + AVGED + AVGED*Years + (1 | Years) + (1 | CDS))

 

model5c = lmer(API ~ 1 + AVGED + (AVGED | Years) + (1 | Years) + (1 | CDS))

 

They produced almost identical predictions.

 

I spoke to another person. I believe that person suggested this model.

 

modelNew = lmer(API ~ 1 + Years + AVGED +  (1 | CDS) + (Years|CDS))

 

This model fit the data too well. For example the prediction for 2009 was slightly below the prediction for 2002 even though as mentioned the 2009 sample mean was substantially above the 2002 sample mean. The AHS AVGED was close to unchanged.

 

Again, previously for each year, I did something like lm(API09 ~ AVGED09). Although the data is not perfectly normal, I obtained regression results that were consistent with my expectations, the residuals were positive the first few years and then became increasing negative.

 

What mixed models might I try?
	[[alternative HTML version deleted]]


