plot_CCDF: Function to plot the CCDF according to the type of X et Z

Description Usage Arguments Value Examples

View source: R/plot_CCDF.R

Description

Function to plot the CCDF according to the type of X et Z

Usage

1
2
3
4
5
6
7
8
9
plot_CCDF(
  Y,
  X,
  Z = NULL,
  method = "linear regression",
  fast = TRUE,
  space_y = FALSE,
  number_y = length(Y)
)

Arguments

Y

a numeric vector of size n containing the preprocessed expressions from n samples (or cells).

X

a numeric or factor vector of size n containing the variable to be tested (the condition to be tested).

Z

a numeric or factor vector of size n containing the covariate. Multiple variables are not allowed.

method

a character string indicating which method to use to compute the CCDF, either 'linear regression', 'logistic regression' and 'permutations' or 'RF' for Random Forests. Default is 'linear regression' since it is the method used in the test.

fast

a logical flag indicating whether the fast implementation of logistic regression should be used. Only if 'dist_permutations' is specified. Default is TRUE.

space_y

a logical flag indicating whether the y thresholds are spaced. When space_y is TRUE, a regular sequence between the minimum and the maximum of the observations is used. Default is FALSE.

number_y

an integer value indicating the number of y thresholds (and therefore the number of regressions) to perform the test. Default is length(Y).

Value

a ggplot object

Examples

1
2
3
X <- as.factor(rbinom(n=100, size = 1, prob = 0.5))
Y <- ((X==1)*rnorm(n = 50,0,1)) + ((X==0)*rnorm(n = 50,0.5,1))
plot_CCDF(data.frame(Y=Y),data.frame(X=X),method="linear regression")

ccdf documentation built on Sept. 24, 2021, 9:07 a.m.