age_table_gen | R Documentation |
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.
age_table_gen(result, q = "median", s = "F")
result |
A data object containing prediction results and metadata. |
q |
A string specifying the quantile of interest (e.g., |
s |
A string indicating the demographic group for which the summary table is generated:
|
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.
A datatable
object (from the DT
package) containing the age trend summary table with the following columns:
Age
: The age values at regular intervals (rounded to the nearest 10).
Percentile.Volume
: The predicted volume values for the specified quantile (only for females or males).
PercentageChange (%)
: The percentage change in volume between consecutive age intervals (only for females or males).
Percentile.Volume_F
: The predicted volume values for females (when comparing genders).
Percentile.Volume_M
: The predicted volume values for males (when comparing genders).
PercentageChange_F (%)
: The percentage change for females (when comparing genders).
PercentageChange_M (%)
: The percentage change for males (when comparing genders).
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")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.