The function estimates the effective number of tests based on one of four different methods. All methods work by extracting the eigenvalues from the R matrix supplied via the R
argument (or from the eigenvalues directly passed via the eigen
argument). Letting _i denote the ith eigenvalue of this matrix (with i = 1, …, k) in decreasing order, the effective number of tests (m) is estimated as follows.
Method by Nyholt (2004)
m = 1 + (k - 1) (1 - Var()k)m = 1 + (k - 1) (1 - Var() / k) where Var()Var() is the observed sample variance of the k eigenvalues.
Method by Li & Ji (2005)
m = _i = 1^k f(|_i|)m = sum_i=1^k f(|_i|) where f(x) = I(x 1) + (x - x )f(x) = I(x 1) + (x - floor(x)) and floor(.) is the floor function.
Method by Gao et al. (2008)
m = (x) \; such that \; _i = 1^x _i_i = 1^k _i > Cm = min(x) such that sum_i=1^x _(i) / sum_i=1^k _(i) > C where C is a pre-defined parameter which is set to 0.995 by default.
Method by Galwey (2009)
m = (_i = 1^k _i')^2_i = 1^k _i'm = (sum_i=1^k _i')^2 / _i=1^k _i' where _i' = [0, _i]_i' = max[0, _i].
Note: For all methods that can yield a non-integer estimate (all but the method by Gao et al., 2008), the resulting estimate m is rounded down to the nearest integer.
Specifying the R Matrix
The R matrix should reflect the dependence structure among the tests. There is no general solution on how such a matrix should be constructed, as this depends on the type of test and the sidedness of these tests. For example, we can use the correlations among related but changing elements across the analyses/tests, or a function thereof, as a proxy for the dependence structure. For example, when conducting k analyses with the same dependent variable and k different independent variables, the correlations among the independent variables could serve as such a proxy. Analogously, if analyses are conducted for k dependent variables with the same set of independent variables, the correlations among the dependent variables could be used instead.
If the tests of interest have test statistics that can be assumed to follow a multivariate normal distribution and a matrix is available that reflects the correlations among the test statistics (which might be approximated by the correlations among the interchanging independent or dependent variables), then the mvnconv
function can be used to convert this correlation matrix into the correlations among the (one- or two-sided) p-values, which in turn can then be passed to the R
argument. See ‘Examples’.
Not Positive Semi-Definite R
Depending on the way R was constructed, it may happen that this matrix is not positive semi-definite, leading to negative eigenvalues. The methods given above can all still be carried out in this case. However, another possibility is to handle such a case by using an algorithm that finds the nearest positive (semi-)definite matrix (e.g., Higham 2002) before passing this matrix to the function (see nearPD
from the Matrix package for a corresponding implementation).