R/subtyper.R
harmonize_sites_quantiles.Rd
Adjusts specified features across sites to match the quantiles (e.g., 25th, 50th, and 75th) of the control group in the reference site. The transformation is applied to all data within each site, regardless of diagnosis, for each feature separately.
harmonize_sites_quantiles(
data,
site_col,
diagnosis_col,
control_label,
feature_cols,
reference_site
)
A data frame containing the data.
A string indicating the column name for site identifiers.
A string indicating the column name for diagnosis identifiers.
The label in the diagnosis column identifying the control group.
A vector of strings specifying the feature columns to be harmonized.
The site identifier to use as the reference site for control quantiles.
A list containing:
harmonized_data
: the data frame with features adjusted across sites.
summary_stats
: a data frame with quantiles (e.g., 25th, 50th, and 75th) by site for each feature.
# harmonize_sites_quantiles(df, site_col = "Site", diagnosis_col = "Diagnosis",
# control_label = "Control", feature_cols = c("Feature1", "Feature2"),
# reference_site = "SiteA")