gamma_k: Order k product-type approximation of multivariate normal...

Description Usage Arguments Details Value Examples

Description

Computes an order k Glaz–Johnson approximation to a multivariate standard normal probability with a given correlation matrix. Gives a familywise error rate level bound in multiple testing for a given local (per-hypothesis) significance level.

Usage

1
gamma_k(k, alphaloc, corr, miwasteps = 4096, genz = FALSE)

Arguments

k

Order of the approximation.

alphaloc

Local significance level (se above).

corr

Either a list of correlations in which the first component is a vector of first-order correlations, the second is a vector of second-order correlations, up to a vector of k - 1-order correlations, or a correlation matrix. Typically the corrs or corrmatrix component given by scorestatcorr.

miwasteps

The steps parameter used for Miwa (algorithms) in pmvnorm.

genz

If TRUE, the GentzBretz algorithm (algorithms) is used for pmvnorm, otherwise the Miwa algorithm is used.

Details

The function is quite slow. For second-order approximation, it is better to use gamma2.

Value

P(|T_1| < c, …, |T_m| < c) is approximated for (T_1, …, T_m) multivariate standard normal with covariances (at least up to order k-1) given by corr, where c is qnorm(1 - alphaloc/2). If (T_1,… T_m) is a test statistic vector for m hypotheses, a local significance level of alphaloc, i.e. rejection of a null hypothesis if the p-value is less than alphaloc, will control familywise error rate at the 1 - gamma_k(alphaloc, corr) level.

Examples

1
2
3
4
5
6
7
8
# Normal model with three environmental covariates:
result <- scorestatcorr(y_normal ~ sex + activity + agecategory, xg[,1:200], 2)
al <- uniroot(function(a) gamma2(a, result$corrs[[1]]) - .95, c(1e-5, 5e-4), tol = 1e-14)$root
al3 <- uniroot(function(a) gamma_k(3, a, result$corrs) - .95, c(1e-5, 5e-4), tol = 1e-14)$root
0.05/2000 # Bonferroni
1 - 0.95^(1/2000) # Sidak
al # order 2 FWER approximation
al3 # order 3 FWER approximation

oyvind-bakke/fwerapprox documentation built on May 29, 2019, 7:35 a.m.