permutationMC {OmicsLonDA} | R Documentation

## Permute group labels

### Description

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

### Usage

    permutationMC(formula = Count ~ Time, perm.dat = NULL, n.perm = 500,
      fit.method = "ssgaussian", points, parall = FALSE, prefix = "Test")

### Arguments

`formula` | formula to be passed to the regression model
`perm.dat` | dataframe has the Count, Group, Subject, Time
`n.perm` | number of permutations
`fit.method` | The fitting method (ssgaussian)
`points` | The points at which the prediction should happen
`parall` | boolean to indicate whether to use multicore.
`prefix` | prefix to be used to create directory for the analysis results

### Value

a list of the fitted model for each group for all the permutations

### References

Ahmed Metwally (ametwall@stanford.edu)

### Examples

    library(SummarizedExperiment)
    data("omicslonda_data_example")
    omicslonda_se_object_adjusted = adjustBaseline(
        se_object = omicslonda_data_example$omicslonda_se_object)
    omicslonda_test_object = omicslonda_se_object_adjusted[1,]
    se_object = omicslonda_test_object
    dt = data.frame(colData(se_object))
    dt$Count = as.vector(assay(se_object))
    Group = as.character(dt$Group)
    group.levels = sort(unique(Group))
    gr.1 = as.character(group.levels[1])
    gr.2 = as.character(group.levels[2])
    df = dt
    levels(df$Group) = c(levels(df$Group), "0", "1")
    df$Group[which(df$Group == gr.1)] = 0
    df$Group[which(df$Group == gr.2)] = 1
    group.0 = df[df$Group == 0, ]
    group.1 = df[df$Group == 1, ]
    points = seq(100, 130)
    perm  = permutationMC(formula = Count ~ Time, perm.dat = df, n.perm = 10,
                          fit.method = "ssgaussian", points = points,
                          parall = FALSE, prefix = tempfile())

[Package OmicsLonDA version 1.3.4 Index]