law: Law school data from Efron and Tibshirani

Description Usage Format Details Source See Also Examples

Description

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.

Usage

1

Format

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

LSAT

a numeric vector

GPA

a numeric vector

Details

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

Source

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

See Also

law82.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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! 

Example output

'data.frame':	15 obs. of  2 variables:
 $ LSAT: num  576 635 558 578 666 580 555 661 651 605 ...
 $ GPA : num  3.39 3.3 2.81 3.03 3.44 3.07 3 3.43 3.36 3.13 ...
[1] 0.7763745
[1] 0.1346768
         0.001       0.01      0.025      0.05       0.1       0.5       0.9
[1,] -1.337795 -0.4670742 -0.2895612 0.1892205 0.4002781 0.7774875 0.9004586
          0.95     0.975     0.99    0.999
[1,] 0.9409117 0.9854672 1.065114 1.109203
           0.001       0.01     0.025      0.05       0.1       0.5       0.9
[1,] -0.05564976 0.07059273 0.2782049 0.3189676 0.4569267 0.7617872 0.8741229
          0.95     0.975      0.99     0.999
[1,] 0.8957463 0.9010135 0.9280448 0.9404489

bootstrap documentation built on June 17, 2019, 5:04 p.m.

Related to law in bootstrap...