# Example 1
# Reproduce Table 3 (p. 574) of Taylor and Russell
r <- seq(0, 1, by = .05)
sr <- c(.05, seq(.10, .90, by = .10), .95)
num.r <- length(r)
num.sr <- length(sr)
old <- options(width = 132)
Table3 <- matrix(0, num.r, num.sr)
for(i in 1 : num.r){
for(j in 1:num.sr){
Table3[i,j] <- TaylorRussell(
SR = sr[j],
BR = .20,
R = matrix(c(1, r[i], r[i], 1), 2, 2),
PrintLevel = 0,
Digits = 3)$PPV
}# END over j
}# END over i
rownames(Table3) <- r
colnames(Table3) <- sr
Table3 |> round(2)
# Example 2
# Thomas, Owen, & Gunst (1977) -- Example 1: Criterion = GPA
R <- matrix(c(1, .5, .7,
.5, 1, .7,
.7, .7, 1), 3, 3)
# See Table 6: Target Acceptance = 20%
out.20 <- TaylorRussell(
SR = c(.354, .354), # the marginal probabilities
BR = .60,
R = R,
PrintLevel = 1)
# See Table 6: Target Acceptance = 50%
out.50 <- TaylorRussell(
SR = c(.653, .653), # the marginal probabilities
BR = .60,
R = R,
PrintLevel = 1)
options(old)
Run the code above in your browser using DataLab