This function shuffles participants' age, group, and sex, thereby destroying correlations between the participants' tract profiles and phenotypic data.
Usage
shuffle_df(
input_df,
dwi_metric,
group_by = "group",
participant_id = "subjectID",
shuffle_vars = NULL,
sample_uniform = FALSE
)
Arguments
- input_df
The input AFQ dataframe
- dwi_metric
The diffusion MRI metric (e.g. "FA", "MD")
- group_by
The grouping variable used to group nodeID smoothing terms
- participant_id
The name of the column that encodes participant ID
- shuffle_vars
List of strings of column names that should be shuffled
- sample_uniform
Boolean flag. If TRUE, shuffling should sample uniformly from the unique values in the columns. If FALSE, shuffling will shuffle without replacement.
Examples
if (FALSE) { # \dontrun{
df_afq <- read.csv("/path/to/afq/output.csv")
df_shuffle <- shuffle_df(df_afq, "dti_fa")
} # }