In each of 8,000 schools I'd like to regress y on x1 and x2 and then generate the predicted value of y. The slopes and intercept may be different in each school. This is a little tricky, because as far as I can tell the predict command isn't byable. So I can't do this:
Paul
by school: reg y x1 x2This works on small datasets:
by school: predict y_predicted
reg y i.school_id##(c.x1 c.x2)but gets very slow if the number of schools is large. Any other ideas? I'm wondering if one of the fixed-effects commands would do the trick. Many thanks!
predict y_predicted
Paul
Comment