I have a dataset with ~120,000 students nested in about 6,000 schools. It contains school-level weights (coded as doubles) and a variable called PUBLIC (dichotomous indicator variable) that varies only at the school level. I run the following code:
The first line uniquely identifies each within-school row, and the "if" condition in the second line is intended to restrict -tabstat- to one row per school.
I get the "too many weights" error when I run the above lines. However, if I do the following, it works:
As far as I can tell, the second is doing the same thing that the first should be doing (i.e., identical data), but the first returns an error and the second doesn't. Obviously, I can work around the error, but it's annoying, and in the future it could mean a lot of preserves/restores that would greatly impact performance. Does anyone know why this is happening?
Darrick
Code:
bysort sch_id: gen sch_row = _n tabstat PUBLIC if sch_row = 1 [aw=sch_weight]
I get the "too many weights" error when I run the above lines. However, if I do the following, it works:
Code:
keep if sch_row = 1 tabstat PUBLIC [aw=sch_weight]
Darrick
Comment