permutation: Permute group labels

Description Usage Arguments Value References Examples

View source: R/Permutation.R

Description

Permutes the group label of the samples in order to construct the AR empirical distibution

Usage

1
2
3
4
5
6
7
8
permutation(
  perm.dat,
  n.perm = 500,
  method = "nbinomial",
  points,
  lev,
  parall = FALSE
)

Arguments

perm.dat

dataframe has the Count, Group, ID, Time

n.perm

number of permutations

method

The fitting method (negative binomial, LOWESS)

points

The points at which the prediction should happen

lev

the two level's name

parall

boolean to indicate whether to use multicore.

Value

returns the fitted model for all the permutations

References

Ahmed Metwally (ametwall@stanford.edu)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(metalonda_test_data)
n.sample = 5
n.timepoints = 10
n.perm = 3
n.group = 2
Group = factor(c(rep(0, n.sample*n.timepoints), rep(1, n.sample*n.timepoints)))
Time = rep(rep(1:n.timepoints, times = n.sample), 2)
ID = factor(rep(1:(2*n.sample), each = n.timepoints))
points = seq(1, 10, length.out = 10)
aggregate.df = data.frame(Count = metalonda_test_data[1,], Time = Time, Group = Group, ID = ID)
prm = permutation(aggregate.df, n.perm = 3, method = "nbinomial", points)

Example output

# of subjects =  10 
Permutation =  1 
Permutation =  2 
Permutation =  3 

MetaLonDA documentation built on Dec. 18, 2019, 9:38 a.m.