Statistical Data Extraction from ggstatsplot
ClinicoPath
2025-07-13
Source:vignettes/jjstatsplot-17-jextractggstats-comprehensive.Rmd
jjstatsplot-17-jextractggstats-comprehensive.Rmd
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
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)
Statistical Methods Supported
Analysis Types
- Histogram Analysis: Single variable distribution with statistical tests
- Between-Groups: Compare means/distributions across groups
- Within-Subjects: Paired/repeated measures comparisons
- Correlation: Relationship between continuous variables
- Scatterplot: Enhanced correlation with marginal distributions
- Bar Chart: Categorical data analysis
- Contingency: Two categorical variables association
- One-Sample: Test against theoretical value
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
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.
Summary
The jextractggstats
function will provide a
comprehensive solution for extracting statistical data from ggstatsplot
analyses within the jamovi framework. Key advantages include:
- Comprehensive Extraction: Access to all statistical components computed by ggstatsplot
- Multiple Analysis Types: Support for various statistical analyses and visualizations
- Flexible Configuration: Extensive customization options for different research needs
- Integration Ready: Extracted data suitable for meta-analysis and custom reporting
- 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.