Description Usage Arguments Value References Examples
View source: R/SAT.estimation.r
This function implements the final SAT estimation based on data pooled from two stages of sampling. A weighted logistic regression is conducted.
1 2 | SAT.estimation(S, X, beta.pilot, stage1.index, stage2.index, stage1.weights,
stage1.y, stage2.y, method = "SAT-S")
|
S |
a binary vector of length n. Surrogate observations for all samples. |
X |
a matrix of dimension n times p (the first column needs to be 1). The covariate matrix contains observations for all n samples. |
beta.pilot |
the pilot estimator. |
stage1.index |
a vector of length r1. The index of pilot sampled patients. |
stage2.index |
a vector of length r. The index of second-stage sampled patients. |
stage1.weights |
a vector of weights for patients who are selected in pilot sampling. |
stage1.y |
a binary vector of length r1. The manual chart review results for patients in |
stage2.y |
a binary vector of length r. The manual chart review results for patients in |
method |
two methods are available: SAT-S or SAT-cY. |
The function returns the final SAT estimates of the association coefficients.
Liu, X., Chubak, J., Hubbard, R. A. & Chen, Y. (2021). SAT: a Surrogate Assisted Two-wave case boosting sampling method, with application to EHR-based association studies.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | library(SAT)
set.seed(0)
n <- 1e5
beta0 <- c(1/5, 0, 0, 1/2, rep(1/2, 4))
d <- length(beta0)
X <- rnorm(n*(d-1), -1.5, 1)
X <- matrix(X, nrow = n, ncol = d - 1)
X <- cbind(1, X)
P <- 1 - 1 / (1 + exp(X %*% beta0))
Y <- rbinom(n, 1, P)
a1 <- 0.85 # sensitivity
a2 <- 0.95 # specificity
pr_s <- vector(mode = "numeric", length = n)
pr_s <- a1*(Y==1) + (1-a2)*(Y==0)
S <- rbinom(n, 1, pr_s)
stage1.index <- SAT.stage1.sampling(r1 = 400, n = 1e5, S, Rpar = 0.5)
stage1.y <- Y[stage1.index]
stage2 <- SAT.stage2.sampling(r1 = 400, n = 1e5, S, Rpar = 0.5, r = 800,
stage1.index, stage1.y, X, method = "SAT-cY")
stage2.y <- Y[stage2$stage2.index]
SAT.est <- SAT.estimation(S, X, beta.pilot = stage2$beta.pilot, stage1.index = stage1.index,
stage2.index = stage2$stage2.index,
stage1.weights = stage2$stage1.weights,
stage1.y = stage1.y, stage2.y = stage2.y,
method = "SAT-cY")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.