SAT.stage2.sampling: Second stage sampling with SAT.

Description Usage Arguments Value References Examples

View source: R/SAT.stage2.sampling.r

Description

This function implements the second stage sampling in SAT by SAT-S or SAT-cY.

Usage

1
SAT.stage2.sampling(r1, n, S, Rpar = 0.5, r, stage1.index, stage1.y, X, method = "SAT-S")

Arguments

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 SAT.stage1.sampling.

r

second stage subsample size.

stage1.index

a vector of length r1. The output of SAT.stage1.sampling, i.e., the index of pilot sampled patients.

stage1.y

a binary vector of length r1. The manual chart review results for patients in stage1.index.

X

a matrix of dimension n times p (the first column needs to be 1). The covariate matrix contains observations for all n samples.

Value

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.

References

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.

Examples

 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

Penncil/SAT documentation built on Dec. 18, 2021, 7:38 a.m.