Perform representational similarity analysis
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()
andstats::cor()
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)"),
R1 = TRUE
)
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)
#> CalmrRSA object
#> ---------------
#> Correlation matrix:
#> HD2022.associations RW1972.associations
#> HD2022.associations 1.0000000 0.3022383
#> RW1972.associations 0.3022383 1.0000000
#> PKH1982.associations -0.9178532 0.1009465
#> PKH1982.associations
#> HD2022.associations -0.9178532
#> RW1972.associations 0.1009465
#> PKH1982.associations 1.0000000
#> ---------------
#> Significance matrix:
#> HD2022.associations RW1972.associations
#> HD2022.associations FALSE FALSE
#> RW1972.associations FALSE FALSE
#> PKH1982.associations FALSE FALSE
#> PKH1982.associations
#> HD2022.associations FALSE
#> RW1972.associations FALSE
#> PKH1982.associations FALSE
#> From 20 permutation samples, two-tailed test with alpha = 0.05.