ziaq_fit: Zero-inflation adjusted quantile regression

Description Usage Arguments Value Examples

Description

This function fits the zero-inflation adjusted quantile regression model for one individual gene.

Usage

1
2
3
4
5
6
7
8
ziaq_fit(
  y,
  colDat,
  formula = ~condition,
  group = "condition",
  probs = c(0.25, 0.5, 0.75),
  log_i = T
)

Arguments

y

a numeric vector including gene expression value for one gen

colDat

a dataframe including the individual cell information

formula

a formula with the predictors included in colDat. The default is ~condition.

group

the variable name in colDat for the factor used in group comparsion. he default is condition.

probs

the quantile levels for the quantile regressions. The default is c(0.25, 0.5, 0.75)

log_i

TRUE or FALSE indicate whether to apply log transformation. The default is TRUE.

Value

pvalue

The p-value for testing the signficance of the specified group variable.

logistic_model

The glm object of the logistics regression for fitting binary outcome (zero or not zero) vs the predictors specified in formula.

zero_proportion

The proportion of zero measurements

quantile_levels

The input quantile levels and zero-proportion adjusted quantile levels

qr

The objects of the fitted quantile regressions

Examples

1
2
3
4
5
6
7
# simulated data
y = round(100* runif(100))
colDat = data.frame(condition = rep(c(1, 0), e = 50))
res = ziaq_fit(y, colDat = colDat,  formula = ~ condition,
              group = 'condition', probs = c(0.25, 0.5, 0.75),
              log_i = TRUE)
print(res)

gefeizhang/ZIAQ documentation built on Feb. 26, 2020, 6:15 p.m.