compareTwoDataSets: Likelihood-Ratio-Test Statistics to Compare the Distribution...

Description Usage Arguments Details Value Author(s) Examples

View source: R/compareTwoDataSets.R

Description

This functions compares the distribution of two sets of RDP-based taxonomic trees using Likelihood-Ratio-Test statistics and a p-value is computed using permutations.

Usage

1
2
	compareTwoDataSets(data1, data2, numPerms = 1000, parallel = FALSE, cores = 3, 
	maxSteps=50, delta=10^(-6), numBootStraps = NULL, enableMC = NULL)

Arguments

data1, data2

Data frames in which each column contains the rdp read counts for every taxa given in the row names.

numPerms

The number of permutation tests to run.

parallel

When this is 'TRUE' it allows for parallel calculation of the permutations. Requires the package doParallel.

cores

The number of parallel processes to run if enableMC is 'TRUE'.

maxSteps

The maximum number of times to iterate though for the MLE.

delta

The minimum threshold of change in f to stop the search for the MLE.

numBootStraps

Deprecated. Replaced with numPerms.

enableMC

Deprecated. Replaced with parallel.

Details

Note: Both data sets should be standardized to the same number of reads.

We are interested in assessing whether the distributions from two metagenomic populations are the same or different, which is equivalent to evaluating whether their respective parameters are the same or different. The corresponding hypothesis is given as follows:

H_{\mathrm{o}}: (g_{1}^{*},τ_{1}) = (g_{2}^{*},τ_{2}) = (g_{0}^{*},τ_{0}) vs H_{\mathrm{A}}: (g_{1}^{*},τ_{1}) \neq (g_{2}^{*},τ_{2}) ,

where (g_{0}^{*},τ_{0}) is the unknown common parameter vector. To evaluate this hypothesis we use the likelihood-ratio test (LRT) which is given by,

λ = -2 \log≤ft(\frac{L(g_{o}^{*},τ_{o};{S_{1n},S_{2m}})}{L(g_{1}^{*},τ_{1};{S_{1n}})+L(g_{2}^{*},τ_{2};{S_{2m}})} \right),

where S_{1n} and S_{2m} are the sets containing n and m random samples of trees from each metagenomic population, respectively. We assume that the model parameters are unknown under both the null and alternative hypothesis, therefore, we estimate these using the MLE procedure proposed in La Rosa et al (see reference 2), and compute the corresponding p-value using non-parametric bootstrap.

Value

A p-value for the similarity of the two data sets based on the permutation test.

Author(s)

Patricio S. La Rosa, Elena Deych, Berkley Shands, William D. Shannon

Examples

1
2
3
4
5
6
7
8
9
	data(saliva)
	data(stool)
	
	### We use 1 for the number of permutations for computation time
	### This value should be at least 1000 for an accurate result
	numPerms <- 1
	
	pval <- compareTwoDataSets(saliva, stool, numPerms)
	pval

Example output

Warning message:
In rownames(data1) != rownames(data2) :
  longer object length is not a multiple of shorter object length
[1] 0.5

HMPTrees documentation built on May 2, 2019, 4:02 p.m.