gamma2: Second-order product-type approximation of multivariate...

Description Usage Arguments Value Examples

Description

Computes a second-order 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
gamma2(alphaloc, corr, tol = 1e-07)

Arguments

alphaloc

Local significance level (se above).

corr

A vector of first-order correlations (i.e., between T_j and T_{j+1} for j = 1, ..., m - 1).

tol

If ||ρ| - 1| ≤ tol for a correlation ρ, then the corresponding factor in the approximation is set to one.

Value

P(|T_1| < c, …, |T_m| < c) is approximated for (T_1, …, T_m) multivariate standard normal with first-order correlations 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 - gamma2(alphaloc, corr) level.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Normal model with three environmental covariates:
result <- scorestatcorr(y_normal ~ sex + activity + agecategory, xg, 2)
pvals <- 2*pnorm(-abs(result$statistic))
# Find alpha_loc controlling FWER at 0.05 level given by order 2 approximation:
al <- uniroot(function(a) gamma2(a, result$corrs[[1]]) - .95, c(1e-5, 5e-4), tol = 1e-14)$root
which(pvals < al)
0.05/2000 # Bonferroni
1 - 0.95^(1/2000) # Sidak
al # order 2 FWER approximation

# Logistic model without environmental covariates:
result_l <- scorestatcorr(y_logistic ~ 1, xg, 2, family = binomial)
al_l <- uniroot(function(a) gamma2(a, result_l$corrs[[1]]) - .95, c(1e-5, 5e-4), tol = 1e-14)$root

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