bone              package:ElemStatLearn              R Documentation

_B_o_n_e _M_i_n_e_r_a_l _D_e_n_s_i_t_y _D_a_t_a

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

     Measurements in the bone mineral density of 261 north american 
     adolescents, as function of age. Each value is the difference in
     spnbmd taken on two consecutive visits, divided by the average.
     The age is the average age over the two visits.

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

     data(bone)

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

     A data frame with 485 observations on the following 4 variables.

     _i_d_n_u_m identifies the child, and hence the repeat measurements

     _a_g_e average of age at two visits

     _g_e_n_d_e_r a factor with levels 'female' 'male'

     _s_p_n_b_m_d Relative Spinal bone mineral density measurement

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

     Bachrach LK, Hastie T, Wang M-C, Narasimhan B, Marcus R. Bone
     Mineral Acquisition in Healthy Asian, Hispanic, Black and
     Caucasian Youth. A Longitudinal Study. J Clin Endocrinol Metab
     (1999) 84, 4702-12.

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

     summary(bone)
     # We ignore the repeat measurements:
     # smooth.spline is in standard package stats.
     names(bone)
     # Plot page 128 in the book:
     plot(spnbmd ~ age, data=bone, col = 
          ifelse(gender=="male", "blue", "red2"), 
          xlab="Age", ylab="Relative Change in Spinal BMD")
     bone.spline.male <- with(subset(bone,gender=="male"),
                     smooth.spline(age, spnbmd,df=12))
     bone.spline.female <- with(subset(bone, gender=="female"), 
                     smooth.spline(age, spnbmd, df=12))
     lines(bone.spline.male, col="blue")
     lines(bone.spline.female, col="red2")
     legend(20,0.20, legend=c("male", "Female"), col=c("blue", "red2"), 
               lwd=2)

