Compute Intersubject Correlation (ISC)

Description

Computes ISC using either the pairwise correlation method or the leave-one-out method. The pairwise method computes a full correlation matrix and averages Fisher-transformed values. The leave-one-out method computes the correlation of each participant’s time series with the mean of all others.

Usage

calculate_isc(data_matrix, method = "pairwise", summary_statistic = "mean")

Arguments

data_matrix A numeric matrix where rows represent time points and columns represent participants.
method A string specifying the ISC computation method. Options are ‘"pairwise"’ (default) or ‘"leave-one-out"’.
summary_statistic A string specifying whether to return ‘"mean"’, ‘"median"’, or ‘"raw"’ ISC values per participant.

Value

A numeric vector of ISC values, one per participant.