Example 8.2 (Bootstrap estimate of standard error). The law school data set law in the bootstrap [286] package is from Efron and Tibshirani [91]. The data frame contains LSAT (average score on law school admission test score) and GPA (average undergraduate grade point average) for 15 law schools. LSAT 576 635 558 578 666 580 555 661 651 605 653 575 545 572 594 GPA 339 330 281 303 344 307 300 343 336 313 312 274 276 288 296 This data set is a random sample from the universe of 82 law schools in law82 (bootstrap). Estimate the correlation between LSAT and GPA scores, and compute the bootstrap estimate of the standard error of the sample correla- tion. 1. For each bootstrap replicate, indexed 6 = 1,..., B: (a) Generate sample () = xi,..., by sampling with replacement from the observed sample 21, ...,xn. 216 Statistical Computing with R (b) Compute the 6th replicate () from the 6th bootstrap sample, where Ô is the sample correlation R between (LSAT, GPA). 2. The bootstrap estimate of se(R) is the sample standard deviation of the replicates (1),..., (B) = R(1), library(bootstrap) R(B). # for the law data print (cor (law$LSAT, law$GPA)) [1] 0.7763745 print (cor (law82$LSAT, law82$GPA)) [1] 0.7599979 The sample correlation is R = 0.7763745. The correlation for the universe of 82 law schools is R = 0.7599979. Use bootstrap to estimate the standard error of the correlation statistic computed from the sample of scores in law. # set up the bootstrap B <- 200 n < nrow(law) R < numeric(B) #number of replicates #sample size #storage for replicates #bootstrap estimate of standard error of R for (b in 1:B) { } #randomly select the indices 1 < sample (1:n, size n, replace=TRUE) LSAT < law$LSAT [i] GPA < law$GPA [i] R[b] print(se.R <- sd (R)) [1] 0.1358393 > hist (R, prob = TRUE) #i is a vector of indices The bootstrap estimate of se(R) is 0.1358393. The normal theory estimate for standard error of R is 0.115. The jackknife-after-bootstrap method of es- timating se(se()) is covered in Section 9.1. The histogram of the replicates of R is shown in Figure 8.1.
Example 8.2 (Bootstrap estimate of standard error). The law school data set law in the bootstrap [286] package is from Efron and Tibshirani [91]. The data frame contains LSAT (average score on law school admission test score) and GPA (average undergraduate grade point average) for 15 law schools. LSAT 576 635 558 578 666 580 555 661 651 605 653 575 545 572 594 GPA 339 330 281 303 344 307 300 343 336 313 312 274 276 288 296 This data set is a random sample from the universe of 82 law schools in law82 (bootstrap). Estimate the correlation between LSAT and GPA scores, and compute the bootstrap estimate of the standard error of the sample correla- tion. 1. For each bootstrap replicate, indexed 6 = 1,..., B: (a) Generate sample () = xi,..., by sampling with replacement from the observed sample 21, ...,xn. 216 Statistical Computing with R (b) Compute the 6th replicate () from the 6th bootstrap sample, where Ô is the sample correlation R between (LSAT, GPA). 2. The bootstrap estimate of se(R) is the sample standard deviation of the replicates (1),..., (B) = R(1), library(bootstrap) R(B). # for the law data print (cor (law$LSAT, law$GPA)) [1] 0.7763745 print (cor (law82$LSAT, law82$GPA)) [1] 0.7599979 The sample correlation is R = 0.7763745. The correlation for the universe of 82 law schools is R = 0.7599979. Use bootstrap to estimate the standard error of the correlation statistic computed from the sample of scores in law. # set up the bootstrap B <- 200 n < nrow(law) R < numeric(B) #number of replicates #sample size #storage for replicates #bootstrap estimate of standard error of R for (b in 1:B) { } #randomly select the indices 1 < sample (1:n, size n, replace=TRUE) LSAT < law$LSAT [i] GPA < law$GPA [i] R[b] print(se.R <- sd (R)) [1] 0.1358393 > hist (R, prob = TRUE) #i is a vector of indices The bootstrap estimate of se(R) is 0.1358393. The normal theory estimate for standard error of R is 0.115. The jackknife-after-bootstrap method of es- timating se(se()) is covered in Section 9.1. The histogram of the replicates of R is shown in Figure 8.1.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 27SA
Related questions
Question
using r language Obtain a bootstrap t confidence interval estimate for the correlation
statistic in Example 8.2 (law data in bootstrap).
![Example 8.2 (Bootstrap estimate of standard error). The law school data
set law in the bootstrap [286] package is from Efron and Tibshirani [91]. The
data frame contains LSAT (average score on law school admission test score)
and GPA (average undergraduate grade point average) for 15 law schools.
LSAT 576 635 558 578 666 580 555 661 651 605 653 575 545 572 594
GPA 339 330 281 303 344 307 300 343 336 313 312 274 276 288 296
This data set is a random sample from the universe of 82 law schools in law82
(bootstrap). Estimate the correlation between LSAT and GPA scores, and
compute the bootstrap estimate of the standard error of the sample correla-
tion.
1. For each bootstrap replicate, indexed 6 = 1,..., B:
(a) Generate sample () = xi,..., by sampling with replacement
from the observed sample 21,
...,xn.
216
Statistical Computing with R
(b) Compute the 6th replicate () from the 6th bootstrap sample, where
Ô is the sample correlation R between (LSAT, GPA).
2. The bootstrap estimate of se(R) is the sample standard deviation of
the replicates (1),..., (B) = R(1),
library(bootstrap)
R(B).
# for the law data
print (cor (law$LSAT, law$GPA))
[1] 0.7763745
print (cor (law82$LSAT, law82$GPA))
[1] 0.7599979
The sample correlation is R = 0.7763745. The correlation for the universe of
82 law schools is R = 0.7599979. Use bootstrap to estimate the standard error
of the correlation statistic computed from the sample of scores in law.
# set up the bootstrap
B <- 200
n <
nrow(law)
R < numeric(B)
#number of replicates
#sample size
#storage for replicates
#bootstrap estimate of standard error of R
for (b in 1:B) {
}
#randomly select the indices
1 < sample (1:n, size n, replace=TRUE)
LSAT < law$LSAT [i]
GPA < law$GPA [i]
R[b] <cor (LSAT, GPA)
#output
> print(se.R <- sd (R))
[1] 0.1358393
> hist (R, prob = TRUE)
#i is a vector of indices
The bootstrap estimate of se(R) is 0.1358393. The normal theory estimate
for standard error of R is 0.115. The jackknife-after-bootstrap method of es-
timating se(se()) is covered in Section 9.1. The histogram of the replicates
of R is shown in Figure 8.1.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4a1c925e-790f-448e-9276-e5adcf0e8758%2Faa0f47a0-5f6b-447b-baf1-c98efe3a2383%2F7sou1h4_processed.png&w=3840&q=75)
Transcribed Image Text:Example 8.2 (Bootstrap estimate of standard error). The law school data
set law in the bootstrap [286] package is from Efron and Tibshirani [91]. The
data frame contains LSAT (average score on law school admission test score)
and GPA (average undergraduate grade point average) for 15 law schools.
LSAT 576 635 558 578 666 580 555 661 651 605 653 575 545 572 594
GPA 339 330 281 303 344 307 300 343 336 313 312 274 276 288 296
This data set is a random sample from the universe of 82 law schools in law82
(bootstrap). Estimate the correlation between LSAT and GPA scores, and
compute the bootstrap estimate of the standard error of the sample correla-
tion.
1. For each bootstrap replicate, indexed 6 = 1,..., B:
(a) Generate sample () = xi,..., by sampling with replacement
from the observed sample 21,
...,xn.
216
Statistical Computing with R
(b) Compute the 6th replicate () from the 6th bootstrap sample, where
Ô is the sample correlation R between (LSAT, GPA).
2. The bootstrap estimate of se(R) is the sample standard deviation of
the replicates (1),..., (B) = R(1),
library(bootstrap)
R(B).
# for the law data
print (cor (law$LSAT, law$GPA))
[1] 0.7763745
print (cor (law82$LSAT, law82$GPA))
[1] 0.7599979
The sample correlation is R = 0.7763745. The correlation for the universe of
82 law schools is R = 0.7599979. Use bootstrap to estimate the standard error
of the correlation statistic computed from the sample of scores in law.
# set up the bootstrap
B <- 200
n <
nrow(law)
R < numeric(B)
#number of replicates
#sample size
#storage for replicates
#bootstrap estimate of standard error of R
for (b in 1:B) {
}
#randomly select the indices
1 < sample (1:n, size n, replace=TRUE)
LSAT < law$LSAT [i]
GPA < law$GPA [i]
R[b] <cor (LSAT, GPA)
#output
> print(se.R <- sd (R))
[1] 0.1358393
> hist (R, prob = TRUE)
#i is a vector of indices
The bootstrap estimate of se(R) is 0.1358393. The normal theory estimate
for standard error of R is 0.115. The jackknife-after-bootstrap method of es-
timating se(se()) is covered in Section 9.1. The histogram of the replicates
of R is shown in Figure 8.1.
AI-Generated Solution
Unlock instant AI solutions
Tap the button
to generate a solution
Recommended textbooks for you

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L


EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage