Skip to contents

Overview

The jextractggstats function provides a comprehensive interface for extracting statistical data from ggstatsplot analyses within the jamovi framework. This function allows researchers to access detailed statistical results computed by ggstatsplot, making them available for custom reporting, meta-analysis, or integration with other analytical workflows.

Note: This function is currently being updated for compatibility with the latest versions of ggstatsplot. The examples below demonstrate the intended functionality.

Key Features

  • Multiple Analysis Types: Supports between-groups comparisons, within-subjects analysis, histogram distributions, correlations, scatterplots, categorical data analysis, contingency table analysis, and one-sample tests
  • Comprehensive Data Extraction: Extracts subtitle data, caption information, pairwise comparisons, and descriptive statistics
  • Flexible Statistical Testing: Supports parametric, non-parametric, robust, and Bayesian methods
  • Customizable Output: Multiple extraction components and formatting options
  • Natural Language Interpretation: Provides automated interpretation of results

Loading Required Packages

library(ClinicoPath)
library(dplyr)
library(ggplot2)

# Load example data
data(histopathology, package = "ClinicoPath")

Basic Usage

Direct ggstatsplot Examples

For now, we demonstrate the underlying ggstatsplot functionality that jextractggstats is designed to work with:

library(ggstatsplot)

# Histogram with statistical details
gghistostats(
  data = histopathology,
  x = Age,
  type = "parametric",
  centrality.plotting = TRUE
)
# Between-groups comparison
ggbetweenstats(
  data = histopathology,
  x = Sex,
  y = Age,
  type = "parametric",
  pairwise.comparisons = TRUE
)
# Correlation analysis
ggscatterstats(
  data = histopathology,
  x = Age,
  y = OverallTime,
  type = "parametric"
)

Intended jextractggstats Usage

Once the compatibility issues are resolved, the function will work as follows:

# Basic histogram analysis with statistical tests
result_histogram <- jextractggstats(
  data = histopathology,
  dep_var = "Age",
  group_var = NULL,
  analysis_type = "histogram",
  extract_components = "all",
  detailed_results = TRUE,
  show_interpretation = TRUE
)

# Between-groups comparison
result_between <- jextractggstats(
  data = histopathology,
  dep_var = "Age",
  group_var = "Sex",
  analysis_type = "between_stats",
  statistical_test = "parametric",
  extract_components = "all",
  pairwise_comparisons = TRUE,
  pairwise_correction = "holm",
  detailed_results = TRUE
)

# Correlation analysis
result_correlation <- jextractggstats(
  data = histopathology,
  dep_var = "Age",
  group_var = "OverallTime",
  analysis_type = "correlation",
  statistical_test = "parametric",
  extract_components = "all",
  detailed_results = TRUE,
  show_interpretation = TRUE
)

Function Parameters

The jextractggstats function supports the following key parameters:

Core Parameters

  • data: The dataset to analyze
  • dep_var: Dependent variable (outcome variable)
  • group_var: Grouping variable (independent variable, optional)
  • analysis_type: Type of analysis (“histogram”, “between_stats”, “correlation”, etc.)

Statistical Options

  • statistical_test: “parametric”, “nonparametric”, “robust”, or “bayes”
  • effect_size_type: “eta”, “omega”, “cohens_d”, “hedges_g”, etc.
  • conf_level: Confidence level (default: 0.95)

Extraction Options

  • extract_components: “all”, “subtitle_data”, “caption_data”, “pairwise_data”, “descriptive_data”
  • pairwise_comparisons: Enable pairwise comparisons (TRUE/FALSE)
  • pairwise_correction: Multiple comparison correction method

Output Options

  • detailed_results: Include detailed statistical summary (TRUE/FALSE)
  • show_interpretation: Include natural language interpretation (TRUE/FALSE)
  • output_format: “table”, “dataframe”, or “json”

Statistical Methods Supported

Analysis Types

  1. Histogram Analysis: Single variable distribution with statistical tests
  2. Between-Groups: Compare means/distributions across groups
  3. Within-Subjects: Paired/repeated measures comparisons
  4. Correlation: Relationship between continuous variables
  5. Scatterplot: Enhanced correlation with marginal distributions
  6. Bar Chart: Categorical data analysis
  7. Contingency: Two categorical variables association
  8. One-Sample: Test against theoretical value

Statistical Tests

  • Parametric: t-tests, ANOVA, Pearson correlation
  • Non-parametric: Mann-Whitney, Kruskal-Wallis, Spearman correlation
  • Robust: Trimmed means, robust statistics
  • Bayesian: Bayesian equivalents with Bayes factors

Clinical Applications

The function is designed for various clinical and pathological research applications:

Biomarker Analysis

  • Compare biomarker levels between patient groups
  • Analyze marker correlations with clinical outcomes
  • Extract effect sizes for meta-analysis

Survival Analysis Components

  • Compare survival times between groups
  • Analyze prognostic factors
  • Extract hazard ratios and confidence intervals

Pathological Grade Analysis

  • Compare continuous variables by tumor grade
  • Analyze categorical associations
  • Multiple comparison corrections

Current Status and Future Development

The jextractggstats function is currently being updated to ensure compatibility with the latest versions of ggstatsplot and related dependencies. The core functionality has been implemented and will be fully functional once the compatibility issues are resolved.

Key Features in Development:

  • Enhanced error handling for edge cases
  • Support for additional ggstatsplot functions
  • Improved data extraction algorithms
  • Better integration with jamovi framework

Summary

The jextractggstats function will provide a comprehensive solution for extracting statistical data from ggstatsplot analyses within the jamovi framework. Key advantages include:

  1. Comprehensive Extraction: Access to all statistical components computed by ggstatsplot
  2. Multiple Analysis Types: Support for various statistical analyses and visualizations
  3. Flexible Configuration: Extensive customization options for different research needs
  4. Integration Ready: Extracted data suitable for meta-analysis and custom reporting
  5. Clinical Applications: Designed for biomarker analysis, survival studies, and pathological research

Key Applications

  • Research Documentation: Extract detailed statistics for manuscripts and reports
  • Meta-Analysis: Gather effect sizes and confidence intervals for systematic reviews
  • Custom Visualization: Access underlying data for specialized plotting
  • Quality Control: Verify statistical computations and assumptions
  • Educational Use: Access step-by-step statistical calculations for teaching

This function bridges the gap between ggstatsplot’s powerful statistical capabilities and the need for detailed, accessible statistical output in clinical and pathological research contexts.

Session Information