age_table_gen {ComBatFamQC}R Documentation

Generate Age Trend Summary Table

Description

This function generates a summary table of age trend predictions for a specified quantile and demographic group. The table includes the predicted volume values, percentage changes between age intervals, and other details for either females, males, or a comparison between both genders.

Usage

age_table_gen(result, q = "median", s = "F")

Arguments

result

A data object containing prediction results and metadata.

q

A string specifying the quantile of interest (e.g., "quantile_50" for the median).

s

A string indicating the demographic group for which the summary table is generated:

  • "F" for female

  • "M" for male

  • "F vs M" for comparison between females and males

Details

The function processes the input data to filter predictions based on the specified quantile and demographic group. It calculates percentage changes in predicted volume values for easier interpretation of trends. For gender comparisons ("F vs M"), it generates side-by-side columns for females and males.

The output table is formatted using the DT package with additional features, such as CSV and Excel export options.

Value

A datatable object (from the DT package) containing the age trend summary table with the following columns:

Examples

sub_df <- age_df[,c("Volume_1", "age", "sex", "ICV_baseline")] |> na.omit()
colnames(sub_df) <- c("Volume_1", "age", "sex", "icv")
age_list <- list("Volume_1" = age_list_gen(sub_df = sub_df))
result <- age_list[[1]]
if(interactive()){
 age_table_gen(result, q = "median", s = "F")
}


[Package ComBatFamQC version 1.0.6 Index]