The context relates to a situation in I am interested to see whether class sizes predict test results. I have each individual's test results, and each individual's class size. I've been warned against simply calculating the test result for each class (thus making a new variable class_test_average, and then using class_size to predict class_test_average. I've been informed that if I do that I may have a problem with "aggregation bias" and "the ecological fallacy". However, these concepts were expressed to me in a somewhat hand-waving way. I have grasped that the ecological fallacy relates to inferences that relationships at macro level will translate into the same relationships at micro level. However, I didn't understand aggregation bias at all.
This isn't practically a serious issue for me as I was planning to do multilevel modeling anyway, which I guess will avert both aggregation bias and the ecological fallacy. However, I am curious about what aggregation bias actually means. There is no Wikipedia article which speaks to this issue, and googling turns up all sorts of definitions. However, I think the classic citation in this area is James (1982).
To me, the term bias indicates that by aggregation I should be systematically pushing the results to either overestimate or underestimate the size of relationships. However, it's not clear to me that that actually happens.
James, L. R. (1982). Aggregation bias in estimates of perceptual agreement. Journal of Applied Psychology, 67(2), 219.