nca_difference: Function for permutation tests

nca_differenceR Documentation

Function for permutation tests

Description

Function for permutation tests

Usage

nca_difference(data1, data2 = NULL, x, y,
ceilings = c("ce_fdh", "cr_fdh"), scope = NULL, test.rep = 1000,
test.type = c("contrast", "independent", "paired"))

Arguments

data1

Dataframe 1.

data2

Dataframe 2, defaults to NULL.

x

Index or name (or a vector of those) with condition(s) x

y

Index or name of the column with the outcome y

ceilings

Vector with the ceiling techniques to test

scope

A theoretical scope in list format : (x.low, x.high, y.low, y.high), see nca_analysis

test.rep

Number of permutations to use, defaults to 1000.

test.type

Name of the test type: "contrast", "independent" or "paired".

Examples

ceilings <- "cr_fdh"
y <- "Y"
test.rep <- 1000

# Contrast test: effect size difference between two conditions
test.type <- "contrast"
data1 <- nca_random(100, c(0.2,0.4), c(1,1))
x <- c("X1", "X2")

difference <- nca_difference(data1 = data1, x = x, y = y,
                             ceilings = ceilings, test.rep = test.rep,
                             test.type = test.type)
print(difference)

# Independent test: effect size difference between two datasets
test.type <- "independent"
data1 <- nca_random(100, 0.2, 1)
data2 <- nca_random(100, 0.4, 1)
x <- "X"

difference <- nca_difference(data1 = data1, data2 = data2, x = x, y = y,
                             ceilings = ceilings, test.rep = test.rep,
                             test.type = test.type)
print(difference)

# paired test: effect size differences between 2 measurements
test.type <- "paired"
data1 <- nca_random(100, 0.2, 1)
data2 <- nca_random(100, 0.4, 1)
x <- "X"

difference <- nca_difference(data1 = data1, data2 = data2, x = x, y = y,
                             ceilings = ceilings, test.rep = test.rep,
                             test.type = test.type)
print(difference)

NCA documentation built on March 20, 2026, 5:08 p.m.