regionpick: Confidence limits for the number of false hypotheses in a...

Description Usage Arguments Details Value Author(s) Examples

View source: R/regionmethod.R

Description

Calculates confidence limits for the number of false hypotheses on the basis of the region procedure within one or more regions.

Usage

1
 regionpick (region, intervals, alpha, silent = FALSE, ignore_weights = TRUE) 

Arguments

region

An object of class region, typically created through a call to regionmethod.

intervals

A list containing one or more regions, specified by a left and rightbound.

alpha

For region objects with adjusted p-values, specifies the value of alpha for which confidence limits are to be calculated (optional).

silent

If FALSE, prints the result to the screen.

ignore_weights

If set to TRUE, a confidence interval for the number of false elementary hypotheses will be computed. If set to FALSE, a confidence interval for the combined weight of false elemenatary hypotheses will be computed.

Details

The function regionpick calculates a confidence interval for the number (or weight) of false hypotheses among a selected set of elementary hypotheses.

Value

The function returns the lower confidence limit for the number of false hypotheses (i.e. true findings) among the set of elementary hypotheses as specified by intervals. The upper confidence limit is always equal to the size of the set.

Author(s)

Rosa Meijer: r.j.meijer@lumc.nl

Examples

 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
#generate data, where the response Y is associated with certain groups of covariates
#namely cov 3-6, 9-12, 15-18
set.seed(1)
n=100
p=20
X <- matrix(rnorm(n*p),n,p)
beta <- c(rep(0,2),rep(1,4),rep(0,2),rep(1,4),rep(0,2),rep(1,4),rep(0,2))
Y <- X %*% beta + rnorm(n)

# Define the local test to be used in the closed testing procedure
mytest <- function(left,right)
{
  X <- X[,(left:right),drop=FALSE]
  lm.out <- lm(Y ~ X)
  x <- summary(lm.out)
  return(pf(x$fstatistic[1],x$fstatistic[2],x$fstatistic[3],lower.tail=FALSE))  
}

# perform the region procedure
reg <- regionmethod(rep(1,p), mytest, isadjusted=TRUE)
summary(reg)

#what are the smallest regions that are found to be significant? 
implications(reg)

#how many covariates within the full region of length 20 are at least associated with the response?
regionpick(reg, list(c(1,p)), alpha=0.05)

#how many covariates within the two subregions, (1,5) and (16,20) 
#are at least associated with the response?
regionpick(reg, list(c(1,5),c(16,20)))

cherry documentation built on May 7, 2021, 5:06 p.m.