Social Structure and Teacher Effects on Academic Achievement: A Comparative Analysis