rsa: Perform representational similarity analysis

View source: R/rsa_functions.R

rsaR Documentation

Perform representational similarity analysis

Description

Perform representational similarity analysis

Usage

rsa(x, comparisons, test = FALSE, ...)

Arguments

x

A list of CalmrExperiment objects

comparisons

A model-named list containing the model outputs to compare.

test

Whether to test the RSA via permutation test. Default = FALSE.

...

Additional parameters passed to stats::dist() and stats::cor()

Value

A CalmrRSA object

Note

The object returned by this function can be later tested via its own test() method.

Examples

# Comparing the associations in three models
exp <- data.frame(
  Group = c("A", "B"),
  P1 = c("!2(A)>(US)/1B>(US)", "!1(A)>(US)/2B>(US)")
)
models <- c("HD2022", "RW1972", "PKH1982")
parameters <- sapply(models, get_parameters, design = exp)
exp_res <- compare_models(exp,
  models = models
)
comparisons <- list(
  "HD2022" = c("associations"),
  "RW1972" = c("associations"),
  "PKH1982" = c("associations")
)
res <- rsa(exp_res, comparisons = comparisons)
test(res, n_samples = 20)

calmr documentation built on June 8, 2025, 1:03 p.m.