law                package:bootstrap                R Documentation

_L_a_w _s_c_h_o_o_l _d_a_t_a _f_r_o_m _E_f_r_o_n _a_n_d _T_i_b_s_h_i_r_a_n_i

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

     The law school data. A random sample of size n=15 from the 
     universe of 82 USA law schools. Two measurements: LSAT  (average
     score on  a national law test) and GPA (average undergraduate 
     grade-point average). 'law82' contains data for the whole universe
     of 82 law schools.

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

             data(law)

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

     A data frame with 15 observations on the following 2 variables.

     _L_S_A_T a numeric vector

     _G_P_A a numeric vector

_D_e_t_a_i_l_s:

     In the book for which this package is support software, this
     example is used to bootstrap the correlation coefficient.

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

     Efron, B. and Tibshirani, R. (1993) An Introduction to the
     Bootstrap. Chapman and Hall, New York, London.

_S_e_e _A_l_s_o:

     'law82'.

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

     str(law)
     if(interactive())par(ask=TRUE)
     plot(law)
     theta <- function(ind) cor(law[ind,1], law[ind,2])
     theta(1:15) # sample estimate
     law.boot <- bootstrap(1:15, 2000, theta)
     sd(law.boot$thetastar) # bootstrap standard error
     hist(law.boot$thetastar)
     # bootstrap t confidence limits for the correlation coefficient:
     theta <- function(ind) cor(law[ind,1], law[ind,2])
     boott(1:15, theta, VS=FALSE)$confpoints
     boott(1:15, theta, VS=TRUE)$confpoints
     # Observe the difference! See page 162 of the book. 
     # abcnon(as.matrix(law), function(p,x) cov.wt(x, p, cor=TRUE)$cor[1,2]  )$limits
     # The above cannot be used, as the resampling vector can take negative values! 

