CrossScreening (version 0.1.1)

cross.screen: Cross-screening

Description

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 \(\Gamma\).

Usage

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)

Arguments

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 gamma.screen (option "threshold") or keep the least sensitive hypotheses (option "least.sensitive").
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 d is positive.

Value

cross.screen returns a list
s1.kappa
kappa values used to screen the hypotheses calculated using the first sample
s1.stat
test statistics chosen using the first sample, if mm has more than 1 column
s1.side
signs of alternative hypotheses chosen using the first sample
s1.order
order of the hypotheses by s1.kappa if s1.kappa is above the threshold gamma.screen
p1
p-values computed using the first sample at sensitivity gamma
s2.kappa
kappa values used to screen the hypotheses calculated using the second sample
s2.stat
test statistics chosen using the second sample, if mm has more than 1 column
s2.side
signs of alternative hypotheses chosen using the second sample
s2.order
order of the hypotheses by s1.kappa if s1.kappa is above the threshold gamma.screen
p2
p-values computed using the second sample at sensitivity gamma
p
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
s1.p
p-values used to screen the hypotheses calculated using the first sample
s1.stat
test statistics chosen using the first sample, if mm has more than 1 column
s1.side
signs of alternative hypotheses chosen using the first sample
s1.order
order of the hypotheses by s1.p if s1.p is below the threshold alpha.screen
p1
p-values computed using the first sample at sensitivity gamma
s2.p
p-values used to screen the hypotheses calculated using the second sample
s2.stat
test statistics chosen using the second sample, if mm has more than 1 column
s2.side
signs of alternative hypotheses chosen using the second sample
s2.order
order of the hypotheses by s2.p if s2.p is above the threshold alpha.screen
p2
p-values computed using the second sample at sensitivity gamma
p
Bonferroni adjusted p-values at sensitivity gamma computed using p1 and p2 (they can be directly used to control FWER)

Functions

  • cross.screen.fg: Cross-screening with fixed \(\Gamma\)

References

Qingyuan Zhao, Dylan S. Small, Paul R. Rosenbaum. Cross-screening in observational studies that test many hypotheses. arXiv preprint arXiv:1703.02078

Examples

Run this code

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)


Run the code above in your browser using DataLab