permDT {ZIprop}R Documentation

Permutations tests

Description

Permutations tests to identify factor correlated to a zero-inflated proportions response. The statistic are the Spearman's correlation for numeric factor and mean by level for other factor.

Usage

permDT(
  DT,
  ColNameFactor,
  B = 1000,
  nclust = 1,
  ColNameWeight = "weight",
  ColNameRecep = "ID.recep",
  ColNameSource = "ID.source",
  seed = NULL,
  no_const = FALSE,
  num_class = ColNameFactor,
  other_class = NULL,
  multiple_test = FALSE,
  adjust_method = "none",
  alpha = 0.05
)

Arguments

DT

a data table contains the factors and the response.

ColNameFactor

a char vector with the name of the selected factor.

B

number of permutations (use at least B=1000 permutations to get a correct accuracy of the p-value.)

nclust

number of proc for parallel computation.

ColNameWeight

a char with the name of the ZI response.

ColNameRecep

colname of the column with the target names

ColNameSource

colname of the column with the contributor names

seed

vector with the seed for the permutations: size(seed)=B

no_const

FALSE for receiver block constraint for permutations: TRUE no constraint.

num_class

a char vector with the name of numeric factor.

other_class

a char vector with the name of other classes than numeric (factor or char).

multiple_test

useful option only for discrete factors: Set TRUE to calculate multiple tests.

adjust_method

p-values adjusted methods (default "none" ). c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY","fdr", "none").

alpha

significant level (default 0.05).

Value

A data frame with two columns. One for the statistics and the other one for the p-value.

Examples

library(data.table)
data(example_data)
res = permDT (example_data,
colnames(example_data)[c(4,10,14,20)],
B = 10,
nclust = 1,
ColNameWeight = "y",
ColNameRecep = "ID.recep",
ColNameSource = "ID.source",
seed = NULL,
num_class = colnames(example_data)[c(4,10)],
other_class = colnames(example_data)[c(14,20)])
print(res)

[Package ZIprop version 0.1.1 Index]