test_diff: Test difference between two posterior distribution

Description Usage Arguments Value See Also

View source: R/resampling_test.R

Description

The function calculates the probability that x is less, greater or just different from y. In addition the function calculates the False sign or small rate (practically equivalent to the false discovery rate) and estimates the mean differrence between x and y.

Usage

1
2
3
test_diff(x, y, sort = FALSE, alternative = c("two.sided", "less",
  "greater"), mu = 0, nmax = ncol(x) * ncol(y),
  pval_adjust_method = "BH", quantiles = c(0.025, 0.975))

Arguments

x

a numeric matrix of with one row for each protein and one column for each MCMC sample. Usually obtained the result of a call to sample_posterior_means().

y

another numeric matrix of with one row for each protein and one column for each MCMC sample. Usually obtained the result of a call to sample_posterior_means(). It must have the same number of rows as x.

sort

boolean indicating if the result is ordered. Default: FALSE. If TRUE the result is ordered by adj_pval. Alternatively you can provide the column name that is used for ordering the resulting data.frame.

alternative

how are x and y compared. Same principles as t.test

mu

test if there is at least distance mu between x and y. Equivalent to calling resampling_test(x, y + mu)

nmax

the maximum number of comparisons. Can be used if the full precision is not needed. Defaults to making all possible comparisons

pval_adjust_method

the method used to adjusted the p-value. See p.adjust.

quantiles

a vector of numbers between 0 and 1 that indicate which quantiles of the difference are calculated in addition to the mean. This is helpful to get an impression of the uncertainty of the difference. By default the 95% credibility interval is calculated ie. quantiles=c(0.025, 0.975).

Value

a data.frame with one row per protein and the following columns

name

the names of each protein extracted from the rownames of x and y

pval

the probability that x is less/greater/different (depending on) the value of alternative than y. As the package is following a Bayesian paradigm this not strictly a p-value, but it for practical reasons can be considered as one.

adj_pval

the multiple testing adjusted p-values using the pval_adjust_method. Again in the Bayesian paradigm it can also be called the False Sign or Small rate.

diff

an estimate of the mean difference between x and y.

'quantile_0.025'

an estiamte of the upper bound of the difference estimate. The actual number of quantile columns is determined by quantiles argument

'quantile_0.975'

an estiamte of the upper bound of the difference estimate

See Also

resampling_test


const-ae/proDD documentation built on Jan. 14, 2020, 9:34 a.m.