signalProp | R Documentation |
Implements an estimator of the signal proportion in settings with arbitrary covariance dependence.
signalProp(pval, pval_null, ...) ## S4 method for signature 'ANY,ANY' signalProp(pval, pval_null, ...) ## S4 method for signature 'ANY,matrix' signalProp(pval, pval_null, ..., alpha = 0.1) ## S4 method for signature 'ANY,big.matrix' signalProp(pval, pval_null, ..., alpha = 0.1) ## S4 method for signature 'ANY,ff_matrix' signalProp(pval, pval_null, ..., alpha = 0.1) ## S4 method for signature 'numeric,missingOrNull' signalProp(pval, pval_null, ..., c05, c1) ## S4 method for signature 'matrix,missingOrNull' signalProp(pval, pval_null, ...) ## S4 method for signature 'big.matrix,missingOrNull' signalProp(pval, pval_null, ..., c05, c1) ## S4 method for signature 'ff_matrix,missingOrNull' signalProp(pval, pval_null, ..., c05, c1) ## S4 method for signature 'ff_array,missingOrNull' signalProp(pval, pval_null, ..., c05, c1) ## S4 method for signature 'ff_vector,missingOrNull' signalProp(pval, pval_null, ..., c05, c1)
pval |
A numeric vector object, a big.matrix object with a single row or col, or an ff_vector, ff_array of single dimension, or ff_matrix with a single row or col p. The p-values. See Details. |
pval_null |
A numeric matrix object, a big.matrix object, or an ff_matrix object of dimension p x n. The p-values generated from the null distribution. The columns correspond to the samples (n), the rows to the signals (p). If not provided (i.e., missing or NULL), inputs c05 and c1 must be provided. If pval_null is provided, only input alpha is required. See Details. |
... |
Ignored. Used only to require named inputs. |
alpha |
A numeric object. The significance level. The bounding sequence is estimated as the (1-alpha)-th quantile. This input is required only if pval_null is provided as input. See Details. |
c05 |
A numeric object. The bounding sequence c_p,0.5 estimated taking delta equal to the square root of the p-value. This input is required only if pval_null is not provided as input. See Details. |
c1 |
A numeric object. The bounding sequence c_p,1 estimated taking delta equal to the p-value. This input is required only if pval_null is not provided as input. See Details. |
This function is multi-use in the sense that the algorithm depends on the combination of inputs provided. If inputs pval, c05, and c1 are provided, the function uses the provided bounding sequence estimates (c05, c1) to estimate the signal proportion. In contrast, if inputs pval, pval_null, and alpha are provided, the function uses pval_null and alpha to estimate the bounding sequences, which are then used to estimate the signal proportion. This latter scenario is equivalent to calling cSeq(pval_null, alpha) to obtain c05 and c1 and providing these as inputs signalProp(pval, c05, c1).
The null p-values can be provided as a numeric matrix, a big.matrix as defined by the bigmemory package, or as an ff_matrix as defined by the ff package. The latter two options allow for larger matrices. Please see the documentation of these packages for details on creating objects.
The p-values can be provided as a numeric vector, a big.matrix with a single column or row, or as an ff object of class (ff_vector, ff_array of 1 dimension or ff_matrix with a single column or row). The latter two options allow for larger vectors.
Further note that if both pval and pval_null are provided as input, they do not have to "match." For example pval can be a standard numeric vector with pval_null specified as a big.matrix.
If estimating the bounding sequence, note that the quantile() function of base R provides 9 algorithms for estimating the quantile, which are based on the definitions of Hyndman and Fan (1996). We have chosen the default (type = 7) here. However, the quantile algorithm implemented in Armadillo is type = 5 and that of ff is type = 1. Thus the results obtained using base, bigmemory, and ff objects containing equivalent data might differ slightly.
An S3 object of class wsiHD comprising a list object. The exact contents depend on the input combination. The list will always include elements:
piHat |
Estimated signal proportion. |
piHat05 |
Estimated signal proportion when delta is set to the square root of the p-value. |
piHat1 |
Estimated signal proportion when delta is set equal to the p-value. |
If the bounding sequences are estimated internally, the list will also include
c05 |
Estimated bounding sequence when delta is set to the square root of the p-value. |
c1 |
Estimated bounding sequence when delta is set equal to the p-value. |
Jeng, X. J. (2021). Estimating the proportion of signal variables under arbitrary covariance dependence. <arXiv:2102.09053>.
data(wsiData) # limit data to expedite example smp <- sample(x = 2:4089, size = 500, replace = FALSE) Sigma <- stats::cor(x = wsiData[,smp]) n <- 100L p <- ncol(x = Sigma) zz <- MASS::mvrnorm(n = n, mu = rep(x = 0.0, times = p), Sigma = Sigma) pval_null <- {1.0 - stats::pnorm(q = abs(x = zz))}*2.0 pval <- stats::runif(n = p) cseq <- cSeq(pval_null = pval_null, alpha = 0.1) signalProp(pval = pval, c05 = cseq$c05, c1 = cseq$c1) # or equivalently obtained in one step as signalProp(pval = pval, pval_null = pval_null, alpha = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.