nlschools                package:MASS                R Documentation

_E_i_g_h_t_h-_G_r_a_d_e _P_u_p_i_l_s _i_n _t_h_e _N_e_t_h_e_r_l_a_n_d_s

_D_e_s_c_r_i_p_t_i_o_n:

     Snijders and Bosker (1999) use as a running example a study of
     2287 eighth-grade pupils (aged about 11) in 132 classes in 131
     schools in the Netherlands.  Only the variables used in our
     examples are supplied.

_U_s_a_g_e:

     nlschools

_F_o_r_m_a_t:

     This data frame contains 2287 rows and the following columns:

     '_l_a_n_g' language test score.

     '_I_Q' verbal IQ.

     '_c_l_a_s_s' class ID.

     '_G_S' class size: number of eighth-grade pupils recorded in the
          class (there may be others: see 'COMB', and some may have
          been omitted with missing values).

     '_S_E_S' social-economic status of pupil's family.

     '_C_O_M_B' were the pupils taught in a multi-grade class ('0/1')? 
          Classes which contained pupils from grades 7 and 8 are coded
          '1', but only eighth-graders were tested.


_S_o_u_r_c_e:

     Snijders, T. A. B. and Bosker, R. J. (1999) _Multilevel Analysis.
     An Introduction to Basic and Advanced Multilevel Modelling._
     London: Sage.

_R_e_f_e_r_e_n_c_e_s:

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth edition.  Springer.

_E_x_a_m_p_l_e_s:

     library(nlme)
     nl1 <- nlschools
     attach(nl1)
     classMeans <- tapply(IQ, class, mean)
     nl1$IQave <- classMeans[as.character(class)]
     nl1$IQ <- nl1$IQ - nl1$IQave
     detach()
     cen <- c("IQ", "IQave", "SES")
     nl1[cen] <- scale(nl1[cen], center = TRUE, scale = FALSE)

     nl.lme <- lme(lang ~ IQ*COMB + IQave + SES,
                   random = ~ IQ | class, data = nl1)
     summary(nl.lme)

