
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Question
using r language Compute a jackknife estimate of the bias and the standard error of the
correlation statistic in Example 8.2.
![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.](https://content.bartleby.com/qna-images/question/4a1c925e-790f-448e-9276-e5adcf0e8758/3d1d1b75-298e-4481-937e-63708a9e0601/1x61j6ss_thumbnail.png)
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.
SAVE
AI-Generated Solution
info
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
Unlock instant AI solutions
Tap the button
to generate a solution
to generate a solution
Click the button to generate
a solution
a solution
Knowledge Booster
Similar questions
- How is an array stored in main memory? How is a linked list stored in main memory? What are their comparative advantages and disadvantages? Give examples of data that would be best stored as an array and as a linked list.arrow_forwardWhat happens to the existing rows of a table if the DEFAULT value of a column is changed?arrow_forward(For thought) a. A token of a computer language is any sequence of characters, with no intervening characters or white space, that taken as a unit has a unique meaning. Using this definition of a token, determine whether escape sequences, function names, and the keywords listed in Table 2.1 are tokens of the C++ language. b. Discuss whether adding white space to a message alters the message and whether messages can be considered tokens of C++. c. Using the definition of a token in Exercise 4a, determine whether the following statement is true: “Except for tokens of the language, C++ ignores all white space.”arrow_forward
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage

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