permuspliner: Permuspliner

View source: R/pk_permusplinectomy.R

permusplinerR Documentation

Permuspliner

Description

Tests for a significant difference between two groups overall.

Usage

Permutation to test whether there is a non-zero trend among a set
of individuals/samples over a continuous variable -- such as time. So, there
does not need to be two groups in this test. The x variable datapoints are
permuated within each case/individual, thus maintaining the distribution in
the y component but shuffling the hypothesized trend.

Arguments

data

A dataframe object containing your data.

xvar

The independent variable; is continuous, e.g. time.

yvar

The dependent variable; is continuous, e.g. temperature.

category

The column name of the category to be tested.

cases

The column name defining the individual cases, e.g. patients.

groups

If more than two groups, the two groups to compare as character vector.

perms

The number of permutations to generate

retain_perm

Retain permuted spline data for permutation confidence interval plotting (set to FALSE for less memory)

test_direction

Test whether the groups are significantly 'more' or significantly 'less' distinct than expected by random chance. Default is 'more'.

set_spar

Set the spar parameter for splines

cut_low

Remove individual cases with fewer than _ observations

ints

Number of x intervals over which to measure area

quiet

Silence all text outputs

set_tol

In rare cases, must manually set the tol parameter (default 1e-4)

cut_sparse

Minimum number of total observations necessary per group to fit a spline (default 4)

Examples

result <- permuspliner(data = ChickWeight, xvar = 'Time',
             yvar = 'weight', category = 'Diet',
             cases = 'Chick', groups = c(1,2))
result$pval

RRShieldsCutler/splinectomeR documentation built on April 24, 2022, 2:20 a.m.