School size, grades served factor into spending