Skip to contents

This function reports normality diagnostics for individual-level gene set scores. The diagnostics are intended to guide downstream model choice and are not used as automatic exclusion criteria.

Usage

brainscore.normality(
  gsScore,
  method = c("ks", "shapiro", "both"),
  alpha = 0.05,
  p_adjust_method = "fdr",
  shapiro_max_n = 5000,
  seed = NULL
)

Arguments

gsScore

A data frame, matrix, or empirical brainscore() output list containing individual gene set scores, with subjects/participants as rows and gene sets as columns.

method

Character string specifying the normality diagnostic method. Default is "ks". Other options are "shapiro" and "both".

alpha

Numeric significance threshold used to flag non-normal score distributions after p-value adjustment. Default is 0.05.

p_adjust_method

Character string specifying the method for p-value adjustment. Default is "fdr". See stats::p.adjust() for details.

shapiro_max_n

Maximum sample size used for Shapiro-Wilk tests. stats::shapiro.test supports at most 5000 observations. Default is 5000.

seed

Optional random seed used when subsampling observations for Shapiro-Wilk tests with more than shapiro_max_n observations.

Value

A data frame with one row per gene set and normality diagnostic columns.