.cluster_permute_test {CellaRepertorium} | R Documentation

## Cell permutation tests (internal)

### Description

Cell permutation tests (internal)

### Usage

    .cluster_permute_test(
      labels,
      covariates,
      strata,
      statistic,
      n_perm,
      alternative,
      ...
    )

### Arguments

`labels` | `factor` of length n
`covariates` | `data.frame` of length n
`strata` | `factor`
`statistic` | function of label (vector) and covariate (data.frame). Must return a scalar
`n_perm` | number of permutations to run
`alternative` | `character` naming the direction `statistic` should be fall under the alternative hypothesis
`...` | passed along to `statistic`

### Value

a list containing the observed value of the statistic, the permuted values of the statistic, its expectation (under independence), a p-value, and the Monte Carlo standard error (of the expected value).

[Package CellaRepertorium version 1.4.0 Index]