Description Usage Arguments Value Functions Author(s) References Examples
Main functions that implements the cross-screening method in observational studies. cross.screen
sorts the hypotheses by their sensitivity values and cross.screen.fg
sorts by p-values at a fixed sensitivity Γ.
1 2 3 4 5 6 7 8 | cross.screen(d1, d2, gamma = 1, mm = c(2, 2, 2), screen.value = c("sen",
"p"), screen.method = c("threshold", "least.sensitive"),
alpha.screen = 0.05, gamma.screen = gamma, least.sensitive = 2,
two.sided = TRUE)
cross.screen.fg(d1, d2, gamma = 1, mm = c(2, 2, 2),
screen.method = c("threshold", "least.sensitive"), alpha.screen = 0.05,
gamma.screen = gamma, least.sensitive = 2, two.sided = TRUE)
|
d1 |
screen/test sample (treatment-minus-control differences), can be a matrix (rows are observations, columns are hypotheses) |
d2 |
test/screen sample, can be a matrix |
gamma |
sensitivity parameter (maximum odds different from a randomized experiment) |
mm |
a vector of matrix. If matrix, adaptively choose statistic. NULL means Wilcoxon's signed rank statistic. |
screen.value |
either "sen" (using sensitivity value) or "p" (using p-value). |
screen.method |
either keep all hypotheses significant at |
alpha.screen |
significance level used in screening. |
gamma.screen |
screening threshold, default is 0, meaning no screening is used. |
least.sensitive |
the number of least sensitive hypotheses to keep |
two.sided |
if TRUE, automatically select the sign to test; if FALSE, test the one-sided alternative that the center of |
cross.screen
returns a list
kappa values used to screen the hypotheses calculated using the first sample
test statistics chosen using the first sample, if mm
has more than 1 column
signs of alternative hypotheses chosen using the first sample
order of the hypotheses by s1.kappa
if s1.kappa
is above the threshold gamma.screen
p-values computed using the first sample at sensitivity gamma
kappa values used to screen the hypotheses calculated using the second sample
test statistics chosen using the second sample, if mm
has more than 1 column
signs of alternative hypotheses chosen using the second sample
order of the hypotheses by s1.kappa
if s1.kappa
is above the threshold gamma.screen
p-values computed using the second sample at sensitivity gamma
Bonferroni adjusted p-values at sensitivity gamma
computed using p1
and p2
(they can be directly used to control FWER)
cross.screen.fg
returns a list
p-values used to screen the hypotheses calculated using the first sample
test statistics chosen using the first sample, if mm
has more than 1 column
signs of alternative hypotheses chosen using the first sample
order of the hypotheses by s1.p
if s1.p
is below the threshold alpha.screen
p-values computed using the first sample at sensitivity gamma
p-values used to screen the hypotheses calculated using the second sample
test statistics chosen using the second sample, if mm
has more than 1 column
signs of alternative hypotheses chosen using the second sample
order of the hypotheses by s2.p
if s2.p
is above the threshold alpha.screen
p-values computed using the second sample at sensitivity gamma
Bonferroni adjusted p-values at sensitivity gamma
computed using p1
and p2
(they can be directly used to control FWER)
cross.screen.fg
: Cross-screening with fixed Γ
Qingyuan Zhao
Qingyuan Zhao, Dylan S. Small, Paul R. Rosenbaum. Cross-screening in observational studies that test many hypotheses. arXiv preprint arXiv:1703.02078
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | n <- 100
p <- 20
d <- matrix(rnorm(n * p), n, p)
d[, 1] <- d[, 1] + 2
d1 <- d[1:(n/2), ]
d2 <- d[(n/2+1):n, ]
cross.screen(d1, d2,
gamma = 9,
gamma.screen = 1.25)$p
## One can run the hidden function CrossScreening:::table5(no.sims = 1)
## to generate Table 5 in the paper.
## The following code generates Table 1 in the paper.
require(CrossScreening)
data(nhanes.fish)
data(nhanes.fish.match)
data <- nhanes.fish
match <- nhanes.fish.match
outcomes <- grep("^o\\.", names(data))
log2diff <- function(y1, y2) {
if (min(c(y1, y2)) == 0) {
y1 <- y1 + 1
y2 <- y2 + 1
}
log2(y1) - log2(y2)
}
d <- sapply(outcomes, function(j) log2diff(data[match$treated, j], data[match$control, j]))
set.seed(11)
split <- sample(1:nrow(d), nrow(d) / 2, replace = FALSE)
d1 <- d[split, ]
d2 <- d[-split, ]
mm <- matrix(c(2, 2, 2, 8, 5, 8), ncol = 2)
data.frame(outcome = names(data)[outcomes],
p.value =
cross.screen(d1, d2,
gamma = 9,
screen.value = "p",
screen.method = "least.sensitive",
mm = mm)$p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.