Description Usage Arguments Value References Examples
View source: R/SAT.stage2.sampling.r
This function implements the second stage sampling in SAT by SAT-S or SAT-cY.
1 | SAT.stage2.sampling(r1, n, S, Rpar = 0.5, r, stage1.index, stage1.y, X, method = "SAT-S")
|
r1 |
pilot subsample size. |
n |
total sample size. |
S |
a binary vector of length n. Surrogate observations for all samples. |
Rpar |
case proportion parameter. Should be the same as in |
r |
second stage subsample size. |
stage1.index |
a vector of length r1. The output of |
stage1.y |
a binary vector of length r1. The manual chart review results for patients in |
X |
a matrix of dimension n times p (the first column needs to be 1). The covariate matrix contains observations for all n samples. |
The function returns a list:
beta.pilot |
the pilot estimator. |
stage1.index |
a vector of index for patients who are selected in pilot sampling. |
stage2.index |
a vector of index for patients who are selected in the second stage sampling. |
stage1.weights |
a vector of weights used in fitting weighted logistic regression for patients who are selected in pilot sampling. |
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 | library(SAT)
set.seed(0)
colnames(lung_cancer)
X <- cbind(1, lung_cancer[,3:5])
Y <- lung_cancer[,1]
S <- lung_cancer[,2]
# pilot sampling
stage1.index <- SAT.stage1.sampling(r1 = 400, n = 1e5, S, Rpar = 0.5)
# true phenotype collection
stage1.y <- Y[stage1.index]
# second stage sampling
stage2 <- SAT.stage2.sampling(r1 = 400, n = 1e5, S, Rpar = 0.5, r = 800,
stage1.index, stage1.y, X, method = "SAT-S")
# true phenotype collection
stage2.y <- Y[stage2$stage2.index]
stage2$beta.pilot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.