The Closure Principle

The closure principle is a way to protect the type-I error from multiple testing. Here, we follow the description in (Bretz, Hothorn, T., and Westfall, P. 2011). It consists of four steps:

1. Definition of a set $${H} = \{H_1,\ldots, H_n\}$$ of elementary hypotheses.

2. Construction of the closure set (“Hypothesis Tree”).

$\overline{H} = \left \{ H_I =\bigcap_{i \in I}H_i : \quad I \subseteq \{1,\ldots,n\} \right \}$ $(\text{all intersection hypotheses} H_I ).$

1. Construction of a local level-$$\alpha$$ test for each $$H_I \in \overline{H}$$.

2. Rejection of $$H_i$$, if all null hypotheses $$H_I \in \overline{H}$$ with $$i \in I$$ are rejected at at the local level $$\alpha$$.

As the null hypothesis $$H_i$$ is rejected only if the null hypotheses $$H_I \in \overline{H}$$ with $$i \in I$$ are rejected (see point 4. above), the adjusted p-value $$p_{adj;i}$$ for $$H_i$$ is defined as:

1. Denote with $$p_I$$ the p-value for a given intersection hypothesis $$H_I, \quad I \subseteq \{1, \ldots,n\}$$.
2. Then, $$p_{adj;i}=\max_\limits{I:i\in I} p_I,\quad i=1,\ldots , n$$.

Implementation

The package was designed in partcular for treatment comparisons in ANOVA-like situations.

Closure set

The hypothesis tree of the closed testing procedure is created using the function IntersectHypotheses.

Local tests for a given “hypothesis tree”

In the case of single hypotheses (i.e. if the hypothesis can be described by a single integer vector e.g. (1,3,5) the test (F-Test, Kruskal-Wallis-test, probability test, logrank test, ….) is applied directly.

For combined hypotheses (i.e. for hypotheses described by several non-overlapping integer vectors eg. (1,2), (3,4), The procedure differs for (generalised) linear hypotheses and other tests.

In the case of generalised linear hypotheses, the contrast matrices for the single hypotheses included are combined and these contrasts are tested simultaneously. Henceforth, functions from the package emmeans(Russell and Lenth 2020) are used, as for all othe linear and generalised linear hypotheses. For all other tests, first the p-values $$p_1, p_2, \ldots ,p_m$$ for the single hypotheses are calculated, and then these are combined by Fisher’s combination rule:

If all $$m$$ hypotheses are assumed to be independent, the test statistics $$X$$ follows under $$H_0$$ a $$\chi^2$$-distribution with $$2m$$ degrees of freedom: $X=-2\sum_{i=1}^{m}\ln(p_i) \sim \chi_{2m}^2$ from which a p-value for the global hypothesis can be easily obtained.

In the case of trend tests, the same type of test is applied for all intermediate single tests.

Finally the p-values for the elementary hypotheses are adjusted by calculating the maximum of the p-values from the hypotheses in the testing set of the respective hypothesis.

The function AnalyseCTP calculates all local p-values and the adjusted p-values for all elementary hypotheses.

With the function Adjust_raw, it is also possible to use p-values that have been calculated by other functions or software to calculate the adjusted p-values.

Testing set for a specific elementary hypothesis

The testing set for a specific elementary hyothesis can be printed by the function TestingSet.

Comparing means

The dataframe pasi comprises the changes in PASI-score (Psoriasis Area and Severity Index) from baseline within two month in 72 patients treated with three different doses of Etretin or Placebo in a double blind study.

The elementary hypotheses 1:2, 1:3, 1:4 are tested simultaneously using the F-Test i.e. $$H_1: \mu_1=\mu_2$$, $$H_2: \mu_1=\mu_3$$ and $$H_3: \mu_1=\mu_4$$ simultaneously. The groups with levels 2,3 and 4 are compared to the control (Placebo) group (level 1). In this specific example, the adjusted and unadjusted p-values are the same. All doses show a significant effect compared to Placebo.  Another hypothesis structure

Testing the elementary hypotheses 1:2, 2:3, 3:4 simultaneously using the F-Test, i.e. testing $$H_1: \mu_1=\mu_2$$, $$H_2: \mu_2=\mu_3$$ and $$H_3: \mu_3=\mu_4$$ simultaneously. This provides quite different results (compared to pasi.ctp.F1): No further improvement for higher doses.  Other tests

For the same hypothesis structure, other tests can also be used:

Kruskal-Wallis test of trend for all single hypotheses Proportions

The data set colorectal contains the response rates from a dose finding study in metastatic colorectal cancer. Two doses of the experimental drug were compared to the standard treatment. The response rates in the two dose groups are compared to the control responder rate using both, the $$\chi^2$$-test and Fisher’s exact test.  Survival Analysis with the logrank test

This example uses the sample dataset ovarian from the package survival. The overall survival curves of the two treatments rx do not differ significantly:

Together with the performance subgroups ecog=1 and ecog=2 , a factor “subgroups” defined by the combinations of the performance measure ecog.ps and the treatment rx.

Then, the treatment differences within the performance subgroups ecog=1 and ecog=2 are compared. I.e. the elementary hypotheses are subgroup11=subgroup12 and subgroup21=subgroup22 or $$\{(1,2),(3,4)\}$$. Comparing means when a covariate is included

In a study with diabetes type II patients (dataset glucose), three doses of a drug are compared to a placebo. The primary variable is the change of fasting plasma glucose from baseline. Fasting plasma glucose at baseline is included into the model as covariate (only implemented for linear and generalised linear models). Large hypothesis trees

Whith an increasing number of hypotheses to test, the graphical display may become quite confusing:

G <- factor(rep(1:5,each=4) )
y <- rnorm(20)
Y <- data.frame(G,y)

xxx <- IntersectHypotheses(list(1:2,c(1,3),c(1,4),c(1,5),c(2,5),c(3,4)))
summary(xxx)
##
## Hypotheses to be tested
## =======================
##
##  hyp.no level hypothesis.name
##       1     1            
##       2     1            
##       3     1            
##       4     1            
##       5     1            
##       6     1            
##       1     2           
##       2     2           
##       3     2           
##       4     2        
##       5     2           
##       6     2           
##       7     2        
##       8     2           
##       9     2        
##      10     2        
##      11     2        
##       1     3          
##       2     3          
##       3     3         
##       4     3          
##       5     3       
##       6     3          
##       7     3       
##       1     4         
##
## Connection structure of the hypotheses
## ======================================
##
##  Level            Connection
##      1          -> 
##      1          -> 
##      1          -> 
##      1       -> 
##      1          -> 
##      1          -> 
##      1          -> 
##      1       -> 
##      1          -> 
##      1          -> 
##      1          -> 
##      1       -> 
##      1          -> 
##      1          -> 
##      1          -> 
##      1       -> 
##      1          -> 
##      1       -> 
##      1       -> 
##      1       -> 
##      1       -> 
##      1          -> 
##      1       -> 
##      1       -> 
##      2        -> 
##      2        -> 
##      2       -> 
##      2        -> 
##      2       -> 
##      2        -> 
##      2        -> 
##      2       -> 
##      2        -> 
##      2     -> 
##      2     -> 
##      2    -> 
##      2  -> 
##      2        -> 
##      2       -> 
##      2        -> 
##      2     -> 
##      2        -> 
##      2       -> 
##      2        -> 
##      2     -> 
##      2    -> 
##      2  -> 
##      2       -> 
##      2        -> 
##      2        -> 
##      2    -> 
##      2     -> 
##      2  -> 
##      2    -> 
##      2  -> 
##      2     -> 
##      2    -> 
##      2  -> 
##      2  -> 
##      3     -> 
##      3      -> 
##      3      -> 
##      3      -> 
##      3   -> 
##      3      -> 
##      3   -> 
Display(xxx) “External” p-values

It is possible to:

• Use IntersectHypotheses to create the closure set and Display to plot the corresponding hypothesis tree.
• Calculate the p-values for the local hypotheses with other functions or software.
• Import these p-values.
• Use Adjust_raw to calculte the adjusted p-values for the elementary hypotheses. Adjust_raw delivers an object of class ctp.
• Use summary and Display on this object. summary(Pairwise)
##
## Hypotheses to be tested
## =======================
##
##  hyp.no level hypothesis.name
##       1     1            
##       2     1            
##       3     1            
##       4     1            
##       5     1            
##       6     1            
##       1     2           
##       2     2           
##       3     2        
##       4     2           
##       5     2        
##       6     2        
##       7     2           
##       1     3          
##
## Connection structure of the hypotheses
## ======================================
##
##  Level         Connection
##      1       -> 
##      1       -> 
##      1    -> 
##      1       -> 
##      1       -> 
##      1    -> 
##      1       -> 
##      1       -> 
##      1    -> 
##      1       -> 
##      1    -> 
##      1       -> 
##      1       -> 
##      1    -> 
##      1       -> 
##      1    -> 
##      1       -> 
##      1       -> 
##      2     -> 
##      2     -> 
##      2  -> 
##      2     -> 
##      2  -> 
##      2  -> 
##      2     -> 

# the vector of p-values calculated by another software
# (Example from Prof. John M. Lachin, The Biostatistics Center Rockville MD)

p.val <- c(
0.4374,
0.6485,
0.4103,
0.2203,
0.1302,
0.6725,
0.4704,
0.3173,
0.6762,
0.7112,
0.2866,
0.3362,
0.2871,
0.4633)

summary(result,digits=3)
##
## Summary of Closed Testing Procedure
## ===================================
##
## Elementary Hypotheses and p-values
## ----------------------------------
##
##  Hypothesis raw p-value adj. p-value
##               0.437        0.676
##               0.648        0.711
##               0.410        0.711
##               0.220        0.470
##               0.130        0.463
##               0.672        0.711

# details may be documented

,dataset.name="my Data", factor.name="Factor"
,factor.levels=c("A","B","C","D"), model=y~Factor
,test.name="my Test")

summary(result,digits=3)
##
## Summary of Closed Testing Procedure
## ===================================
##
## Model : y ~ Factor , test : my Test
##
## Factor levels: 1=A, 2=B, 3=C, 4=D
##
## Elementary Hypotheses and p-values
## ----------------------------------
##
##  Hypothesis raw p-value adj. p-value
##               0.437        0.676
##               0.648        0.711
##               0.410        0.711
##               0.220        0.470
##               0.130        0.463
##               0.672        0.711