combat_table_gen function

Generate Diagnostic Tables for Batch Effect Analysis

Generate Diagnostic Tables for Batch Effect Analysis

This function generates a variety of tables to summarize data and results from batch effect analyses. Depending on the specified table name, it can create data overview tables, exploratory analysis summaries, statistical test results, PCA summaries, and covariate distributions.

combat_table_gen( result, table_name, f = NULL, c = NULL, PC1 = NULL, PC2 = NULL )

Arguments

  • result: A list derived from visual_prep() that contains datasets and statistical test results for Shiny visualization.

  • table_name: A string specifying the type of table to generate. Options include:

    • "data_overview": Overview of the dataset, including covariates, features, and batch information.
    • "exploratory_analysis": Summary of the selected feature and covariates.
    • "summary_df": Summary of batch-level distributions, including batch removal status.
    • "cov_table": Covariate summary table, displaying distributions for numeric or categorical covariates.
    • "pc_variance": Variance explained by specified principal components.
    • "mdmr": Results from the Multivariate Distance Matrix Regression (MDMR) analysis.
    • "kenward_roger": Results from Kenward-Roger tests.
    • "anova": Results from ANOVA tests.
    • "kruskal_wallis": Results from Kruskal-Wallis tests.
    • "fligner_killeen": Results from Fligner-Killeen tests.
    • "levenes": Results from Levene's tests.
    • "bartletts": Results from Bartlett's tests.
  • f: A string specifying the feature of interest for tables requiring a specific feature. Default is NULL.

  • c: A string specifying the covariate of interest for tables requiring a specific covariate. Default is NULL.

  • PC1: A string specifying the first principal component for PCA variance tables. Default is NULL.

  • PC2: A string specifying the second principal component for PCA variance tables. Default is NULL.

Returns

A DT::datatable object containing the requested table.

Details

The function dynamically generates tables based on the table_name parameter.

Examples

if(interactive()){ result <- visual_prep(type = "lm", features = "thickness.left.cuneus", batch = "manufac", covariates = "AGE", df = adni[1:100, ], mdmr = FALSE, cores = 1) combat_table_gen(result, table_name = "cov_table", c = "AGE") combat_table_gen(result, table_name = "pc_variance", PC1 = "PC1", PC2 = "PC2") }