ZINQ_tests | R Documentation |
Marginal tests for the Firth logistic and quantile regression components
ZINQ_tests(
formula.logistic,
formula.quantile,
C,
y_CorD = "C",
data,
taus = c(0.1, 0.25, 0.5, 0.75, 0.9),
seed = 2020
)
formula.logistic |
The full model of Firth logistic regression, e.g., Y ~ X + Y + Z, where Y is zero-inflated. |
formula.quantile |
The full model of quantile regression, can be different from |
C |
The name(s) of clinical variable(s) of interest, e.g., "Condition" or c("Condition", "Batch"). |
y_CorD |
An indicator: use "D" if Y is count, a perturbation from U(0, 1) will be added to the response; use "C" if Y is continuous; default is "C". |
data |
A data.frame: better cleaned and processed, use numeric for Y and binary covariates, use factor for multi-class discrete covariates. |
taus |
A grid of quantile levels, e.g., 0.5 for the median, 0.75 for the 3rd quartile; default is c(0.1, 0.25, 0.5, 0.75, 0.9). |
seed |
A seed for perturbation when |
Compositional data is regarded as continuous, determined by its support.
taus
is a tuning parameter that does not have an efficient selection process yet, try from coarsed to fine grids (e.g., seq(0.1, 0.9, by=0.2) to seq(0.1, 0.9, by=0.1)),
or try adding more extreme levels (e.g., c(0.25, 0.5, 0.75) to c(0.1, 0.25, 0.5, 0.75, 0.9)), with a goal to keep type I error controlled and boost the power;
for common taxa, start from the default; for rare taxa, start from c(0.25, 0.5, 0.75).
Quantile rank-score test corrected for zero-inflation is used for the quantile regression component.
Penalized likelihood-ratio test is used for the Firth logistic regression component.
A list
pvalue.logistic - A single p-value from the Firth logistic regression component.
pvalue.quantile - A length(taus
) by 1 vector, a sequence of p-values from the quantile regression component.
Sigma.hat - A df x length(taus
) by df x length(taus
) matrix, where df is the dimension of C
, the covariance matrix of quantile rank-scores.
zerorate - The proportion of zeroes in Y.
taus - The grid of quantile levels used.
Ling, W. et al. (2021). Powerful and robust non-parametric association testing for microbiome data via a zero-inflated quantile approach (ZINQ). Microbiome 9, 181.
Machado, J.A.F., Silva, J.S. (2005). Quantiles for counts. Journal of the American Statistical Association 100(472), 1226–1237.
n = 300
p <- function(x0, gam0=0.75, gam1=-0.15){
lc = gam0 + gam1*x0
exp(lc) / (1 + exp(lc))
}
x = c(rep(0, n), rep(1, n))
w = 0.5 + 1.5*x + (1+0.15*x)*rchisq(2*n,df=1)
b = rbinom(2*n, 1, p(x))
y = w*b
dat = data.frame(y, x)
ZINQ_tests(formula.logistic=y~x, formula.quantile=y~x, C="x", data=dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.