# hierarchicalFWER: Hierarchical testing with FWER control In MLGL: Multi-Layer Group-Lasso

## Description

Apply hierarchical test for each hierarchy, and test external variables for FWER control at level alpha

## Usage

 ```1 2 3 4 5 6 7 8 9``` ```hierarchicalFWER( X, y, group, var, test = partialFtest, Shaffer = FALSE, addRoot = FALSE ) ```

## Arguments

 `X` original data `y` associated response `group` vector with index of groups. group[i] contains the index of the group of the variable var[i]. `var` vector with the variables contained in each group. group[i] contains the index of the group of the variable var[i]. `test` function for testing the nullity of a group of coefficients in linear regression. The function has 3 arguments: `X`, the design matrix, `y`, response, and `varToTest`, a vector containing the indices of the variables to test. The function returns a p-value `Shaffer` boolean, if TRUE, a Shaffer correction is performed `addRoot` If TRUE, add a common root containing all the groups

## Details

Version of the hierarchical testing procedure of Meinshausen for MLGL output. You can use th selFWER function to select groups at a desired level alpha

## Value

a list containing:

pvalues

pvalues of the different test (without correction)

groupId

Index of the group

hierMatrix

Matrix describing the hierarchical tree.

## References

Meinshausen, Nicolai. "Hierarchical Testing of Variable Importance." Biometrika 95.2 (2008): 265-78.

 ```1 2 3 4 5``` ```set.seed(42) X <- simuBlockGaussian(50, 12, 5, 0.7) y <- X[, c(2, 7, 12)] %*% c(2, 2, -2) + rnorm(50, 0, 0.5) res <- MLGL(X, y) test <- hierarchicalFWER(X, y, res\$group[], res\$var[]) ```