cosinePerm: Cosine Permutations

Description Usage Arguments Value Examples

View source: R/cosinePerm.R

Description

Computes the cosine similarity and significance using permutation test. This function uses random numbers, to ensure reproducibility please call set.seed() before running the function.

Usage

1
2
3
4
5
6
7
8
9
cosinePerm(
  x,
  y,
  nperm = 1000,
  alternative = c("two.sided", "less", "greater"),
  include.perm = FALSE,
  nthread = 1,
  ...
)

Arguments

x

factor is the factors for the first variable

y

factor is the factors for the second variable

nperm

integer is the number of permutations to compute the null distribution of MCC estimates

alternative

string indicates the alternative hypothesis and must be one of <e2><80><98>'two.sided'<e2><80><99>, <e2><80><98>'greater'<e2><80><99> or <e2><80><98>'less'<e2><80><99>. You can specify just the initial letter. <e2><80><98>'greater'<e2><80><99> corresponds to positive association, <e2><80><98>'less'<e2><80><99> to negative association. Options are 'two.sided', 'less', or 'greater'

include.perm

boolean indicates whether the estimates for the null distribution should be returned. Default set to 'FALSE'

nthread

integer is the number of threads to be used to perform the permutations in parallel

...

A list of fallthrough parameters

Value

A list estimate of the cosine similarity, p-value and estimates after random permutations (null distribution) in include.perm is set to 'TRUE'

Examples

1
2
3
x <- factor(c(1,2,1,2,1))
y <- factor(c(2,2,1,1,1))
cosinePerm(x, y)

CoreGx documentation built on Nov. 8, 2020, 4:50 p.m.