Skip to contents

Introduction

The desctools function in ClinicoPath provides access to advanced statistical tests from the DescTools R package, specifically designed for clinical and epidemiological research. This comprehensive tool offers three major categories of statistical analysis:

  1. Effect Size Analysis - Cohen’s D and Hedges’ g for quantifying practical significance
  2. Goodness of Fit Tests - Hosmer-Lemeshow test for model validation and normality testing
  3. Advanced Categorical Tests - Cochran-Armitage trend test and other specialized categorical analyses

When to Use Advanced Statistical Tests

Advanced statistical tests are essential when:

  • Effect sizes matter: Moving beyond p-values to understand practical significance
  • Model validation needed: Assessing whether logistic regression models fit the data adequately
  • Categorical relationships complex: Testing for trends, dose-response relationships, or stratified analyses
  • Clinical interpretation crucial: Providing meaningful results for medical decision-making

Data Requirements

The desctools function works with various data types:

  • Effect Size Analysis: Requires a grouping variable (2 levels) and a continuous outcome
  • Goodness of Fit: Requires fitted probabilities and observed outcomes, or continuous variables for normality testing
  • Categorical Tests: Requires categorical variables, ordered exposures, and binary outcomes
# Load required libraries
library(ClinicoPath)

# Load example datasets
data("histopathology")
data("dca_test_data")
data("BreastCancer")

# Display dataset structure
str(histopathology[, c("Group", "Sex", "Age", "Grade", "Death", "MeasurementA")])
## tibble [250 × 6] (S3: tbl_df/tbl/data.frame)
##  $ Group       : chr [1:250] "Control" "Treatment" "Control" "Treatment" ...
##  $ Sex         : chr [1:250] "Male" "Female" "Male" "Male" ...
##  $ Age         : num [1:250] 27 36 65 51 58 53 33 26 25 68 ...
##  $ Grade       : num [1:250] 2 2 1 3 2 2 1 2 3 3 ...
##  $ Death       : chr [1:250] "YANLIŞ" "DOĞRU" "DOĞRU" "YANLIŞ" ...
##  $ MeasurementA: num [1:250] -1.63432 0.37071 0.01585 -1.23584 -0.00141 ...

Effect Size Analysis

Effect size analysis quantifies the magnitude of differences between groups, providing crucial information about practical significance beyond statistical significance.

Cohen’s D for Group Comparisons

Cohen’s D measures the standardized difference between two group means:

# Basic effect size analysis comparing age between treatment groups
result_basic <- desctools(
  data = histopathology,
  effect_size_analysis = TRUE,
  group_var = "Group",
  continuous_var = "Age"
)

print(result_basic)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxControl12049.82514.4152673Treatment12848.96913.2562573
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeCohen's d0.062-0.1870.311Negligible
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is negligible, suggesting
##  minimal practical difference between groups.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8

Hedges’ Correction for Small Samples

When sample sizes are small (< 20 per group), Hedges’ correction provides a less biased estimate:

# Effect size analysis with Hedges' correction
result_hedges <- desctools(
  data = histopathology,
  effect_size_analysis = TRUE,
  group_var = "Sex",
  continuous_var = "MeasurementA",
  pooled_sd = TRUE,
  hedges_correction = TRUE,  # Apply bias correction
  effect_ci_level = 0.90,
  show_interpretations = TRUE
)

print(result_hedges)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxMale1280.0960.911-2.4982.104Female1210.0590.829-1.9792.292
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeHedges' g0.042-0.1670.251Negligible
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is negligible, suggesting
##  minimal practical difference between groups.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8

Clinical Example: Biomarker Comparison

Using the BreastCancer dataset to compare cell thickness between benign and malignant cases:

# Clinical application with cancer data
result_clinical <- desctools(
  data = BreastCancer,
  effect_size_analysis = TRUE,
  group_var = "Class",
  continuous_var = "Cl.thickness",
  pooled_sd = FALSE,  # Use separate group variances
  hedges_correction = FALSE,
  effect_ci_level = 0.95,
  cat_var2 = NULL,
  show_interpretations = TRUE
)

print(result_clinical)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxbenign4582.9561.67418malignant2417.1952.429110
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeCohen's d-1.505-1.68-1.33Large
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is large and represents a
##  substantial clinical difference between groups.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8

Goodness of Fit Tests

Goodness of fit tests assess whether statistical models adequately represent the observed data.

Hosmer-Lemeshow Test for Logistic Regression

The Hosmer-Lemeshow test evaluates the calibration of logistic regression models:

# Test model calibration using fitted probabilities
result_hl <- desctools(
  data = dca_test_data,
  effect_size_analysis = FALSE,
  goodness_of_fit = TRUE,
  fitted_probs = "basic_model",
  observed_outcomes = "cardiac_event_numeric",
  hl_groups = 10,  # Standard 10 groups
  categorical_tests = FALSE,
  cat_var1 = NULL,
  cat_var2 = NULL,
  show_goodness_tests = TRUE,
  show_interpretations = TRUE
)

print(result_hl)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Goodness of Fit Tests
## 
##  Hosmer-Lemeshow Goodness of Fit Test
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>StatisticValuedfp-valueC
##  Statistic25.582480.0012
## 
##  Interpretation: Poor model fit (p ≤ 0.05). Consider model revision or
##  additional predictors.

Normality Testing

Anderson-Darling and Jarque-Bera tests assess whether continuous variables follow a normal distribution:

# Test normality of continuous variables
result_normality <- desctools(
  data = histopathology,
  effect_size_analysis = FALSE,
  goodness_of_fit = TRUE,
  normality_var = "Age",
  show_goodness_tests = TRUE,
  show_interpretations = TRUE
)

print(result_normality)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Goodness of Fit Tests
## 
##  Normality Tests
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>TestStatisticp-valueConclusionAnderson-DarlingInf0Non-normalJarque-Bera11.43210.0033Non-normal

Enhanced Model Validation

Testing multiple models with different group sizes:

# Enhanced model with fewer groups for stability
result_enhanced <- desctools(
  data = dca_test_data,
  effect_size_analysis = FALSE,
  goodness_of_fit = TRUE,
  fitted_probs = "enhanced_model",
  observed_outcomes = "cardiac_event_numeric",
  hl_groups = 8,  # Fewer groups for small samples
  normality_var = "troponin",
  show_goodness_tests = TRUE
)

print(result_enhanced)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Goodness of Fit Tests
## 
##  Hosmer-Lemeshow Goodness of Fit Test
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>StatisticValuedfp-valueC
##  Statistic5.67860.4602
## 
##  Interpretation: Good model fit (p > 0.05). The model adequately fits
##  the data.
## 
##  Normality Tests
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>TestStatisticp-valueConclusionAnderson-DarlingInf0Non-normalJarque-Bera7137.03990Non-normal

Advanced Categorical Tests

Advanced categorical tests examine complex relationships in categorical data, including trends and dose-response patterns.

Cochran-Armitage Trend Test

This test identifies linear trends in proportions across ordered exposure levels:

# Test for trend across tumor grades
result_trend <- desctools(
  data = histopathology,
  categorical_tests = TRUE,
  ordered_exposure = "Grade",
  binary_outcome = "Death",
  show_categorical_tests = TRUE,
  show_interpretations = TRUE
)

print(result_trend)
## 
##  ADVANCED STATISTICAL TESTS
## 
##  <div style='color: red; font-weight: bold;'>Error in statistical
##  analysis: unused argument (g = exposure_data)
## 
##  Please check your variable selections and data format.
## 
## character(0)

Multiple Categorical Variables

Analyzing relationships between multiple categorical variables:

# Complex categorical analysis
result_complex <- desctools(
  data = histopathology,
  categorical_tests = TRUE,
  cat_var1 = "Group",
  cat_var2 = "Sex",
  ordered_exposure = "TStage",
  binary_outcome = "Outcome",
  show_categorical_tests = TRUE
)

print(result_complex)
## 
##  ADVANCED STATISTICAL TESTS
## 
##  <div style='color: red; font-weight: bold;'>Error in statistical
##  analysis: unused argument (g = exposure_data)
## 
##  Please check your variable selections and data format.
## 
## character(0)

Multiple Testing Correction

When performing multiple statistical tests, correction for multiple comparisons is essential to control the family-wise error rate.

Available Correction Methods

# Analysis with Benjamini-Hochberg FDR correction
result_corrected <- desctools(
  data = histopathology,
  effect_size_analysis = TRUE,
  group_var = "Group",
  continuous_var = "Age",
  goodness_of_fit = TRUE,
  normality_var = "MeasurementA",
  categorical_tests = TRUE,
  ordered_exposure = "Grade",
  binary_outcome = "Death",
  multiple_testing = "BH",  # False Discovery Rate control
  show_effect_sizes = TRUE,
  show_goodness_tests = TRUE,
  show_categorical_tests = TRUE,
  show_interpretations = TRUE
)

print(result_corrected)
## 
##  ADVANCED STATISTICAL TESTS
## 
##  <div style='color: red; font-weight: bold;'>Error in statistical
##  analysis: unused argument (g = exposure_data)
## 
##  Please check your variable selections and data format.
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxControl12049.82514.4152673Treatment12848.96913.2562573
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeCohen's d0.062-0.1870.311Negligible
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is negligible, suggesting
##  minimal practical difference between groups.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Goodness of Fit Tests
## 
##  Normality Tests
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>TestStatisticp-valueConclusionAnderson-DarlingInf0Non-normalJarque-Bera0.74330.6896Normal
## 
## character(0)

Comparison of Correction Methods

# Bonferroni correction for strict control
result_bonferroni <- desctools(
  data = histopathology,
  effect_size_analysis = TRUE,
  group_var = "Sex",
  continuous_var = "MeasurementB",
  multiple_testing = "bonferroni"  # More conservative
)

print(result_bonferroni)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxMale1280.950.573-0.7432.372Female1210.9850.555-0.4792.566
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeCohen's d-0.061-0.310.187Negligible
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is negligible, suggesting
##  minimal practical difference between groups.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8

Comprehensive Analysis Workflow

Complete Statistical Analysis

Combining all three analysis types for a comprehensive evaluation:

# Full analysis pipeline
result_comprehensive <- desctools(
  data = histopathology,
  # Effect Size Analysis
  effect_size_analysis = TRUE,
  group_var = "Group",
  continuous_var = "Age",
  pooled_sd = TRUE,
  hedges_correction = FALSE,
  effect_ci_level = 0.95,
  # Goodness of Fit Tests
  goodness_of_fit = TRUE,
  normality_var = "MeasurementA",
  # Categorical Tests
  categorical_tests = TRUE,
  ordered_exposure = "Grade",
  binary_outcome = "Death",
  # Multiple Testing and Display
  multiple_testing = "BH",
  show_effect_sizes = TRUE,
  show_goodness_tests = TRUE,
  show_categorical_tests = TRUE,
  show_interpretations = TRUE
)

print(result_comprehensive)
## 
##  ADVANCED STATISTICAL TESTS
## 
##  <div style='color: red; font-weight: bold;'>Error in statistical
##  analysis: unused argument (g = exposure_data)
## 
##  Please check your variable selections and data format.
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxControl12049.82514.4152673Treatment12848.96913.2562573
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeCohen's d0.062-0.1870.311Negligible
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is negligible, suggesting
##  minimal practical difference between groups.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Goodness of Fit Tests
## 
##  Normality Tests
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>TestStatisticp-valueConclusionAnderson-DarlingInf0Non-normalJarque-Bera0.74330.6896Normal
## 
## character(0)

Clinical Research Applications

Oncology Research Example

Analyzing treatment effectiveness in cancer patients:

# Create subset for oncology analysis
oncology_data <- histopathology[!is.na(histopathology$Grade) & 
                                !is.na(histopathology$Group), ]

# Comprehensive oncology analysis
result_oncology <- desctools(
  data = oncology_data,
  effect_size_analysis = TRUE,
  group_var = "Group",
  continuous_var = "OverallTime",  # Survival time
  hedges_correction = TRUE,
  categorical_tests = TRUE,
  ordered_exposure = "Grade",  # Tumor grade progression
  binary_outcome = "Death",
  multiple_testing = "BH",
  show_interpretations = TRUE
)

print(result_oncology)
## 
##  ADVANCED STATISTICAL TESTS
## 
##  <div style='color: red; font-weight: bold;'>Error in statistical
##  analysis: unused argument (g = exposure_data)
## 
##  Please check your variable selections and data format.
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxControl11916.11213.6392.957.7Treatment12716.87713.4853.158.2
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeHedges' g-0.056-0.3060.194Negligible
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is negligible, suggesting
##  minimal practical difference between groups.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8
## 
## character(0)

Biomarker Validation Study

Validating diagnostic biomarkers with effect sizes and model calibration:

# Biomarker validation analysis
result_biomarker <- desctools(
  data = BreastCancer,
  effect_size_analysis = TRUE,
  group_var = "Class",
  continuous_var = "Cell.size",
  goodness_of_fit = TRUE,
  normality_var = "Cl.thickness",
  multiple_testing = "holm",
  show_interpretations = TRUE
)

print(result_biomarker)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxbenign4581.3250.90819malignant2416.5732.72110
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeCohen's d-2.987-3.207-2.765Large
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is large and represents a
##  substantial clinical difference between groups.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Goodness of Fit Tests
## 
##  Normality Tests
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>TestStatisticp-valueConclusionAnderson-DarlingInf0Non-normalJarque-Bera44.48610Non-normal

Interpretation Guidelines

Effect Size Interpretation

Cohen’s Conventions: - Small effect: d = 0.2 - Medium effect: d = 0.5
- Large effect: d = 0.8

Clinical Significance: - Consider clinical context, not just statistical thresholds - Small effects may be clinically meaningful in large samples - Large effects may not be clinically relevant if impractical

Goodness of Fit Interpretation

Hosmer-Lemeshow Test: - p > 0.05: Good model fit (model adequately fits data) - p ≤ 0.05: Poor model fit (consider model revision)

Normality Tests: - p > 0.05: Data consistent with normal distribution - p ≤ 0.05: Evidence against normality

Categorical Test Interpretation

Cochran-Armitage Trend: - p ≤ 0.05: Significant linear trend detected - Evidence of dose-response relationship - Important for exposure-outcome studies

Best Practices

Sample Size Considerations

  1. Effect Size Analysis: Minimum 10 observations per group
  2. Hosmer-Lemeshow Test: At least 100 observations recommended
  3. Categorical Tests: Adequate cell counts (≥5 per cell)

Model Validation Workflow

  1. Fit your logistic regression model
  2. Extract fitted probabilities
  3. Run Hosmer-Lemeshow test
  4. If p ≤ 0.05, consider:
    • Adding interaction terms
    • Including additional predictors
    • Transforming variables

Multiple Testing Strategy

  1. Plan your analysis before seeing the data
  2. Use FDR (Benjamini-Hochberg) for exploratory studies
  3. Use Bonferroni for confirmatory studies
  4. Report both raw and adjusted p-values

Advanced Features

Custom Confidence Levels

# Analysis with 99% confidence intervals
result_99ci <- desctools(
  data = histopathology,
  effect_size_analysis = TRUE,
  group_var = "Group",
  continuous_var = "MeasurementA",
  effect_ci_level = 0.99,  # Higher confidence level
  show_interpretations = TRUE
)

print(result_99ci)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Effect Size Analysis
## 
##  Group Summary Statistics
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight:
##  bold;'>GroupNMeanSDMinMaxControl120-0.0690.876-2.4982.049Treatment1290.20.858-1.5472.292
## 
##  Effect Size Results
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>MeasureValueLower CIUpper
##  CIMagnitudeCohen's d-0.31-0.6390.019Small
## 
##  Clinical Interpretation
## 
##  <div style='background-color: #f9f9f9; padding: 10px; border-left: 4px
##  solid #007acc;'>
## 
##  Effect Size Interpretation: The effect size is small but potentially
##  clinically meaningful, especially in large samples.
## 
##  Cohen's Conventions:
## 
##  Small effect: d = 0.2Medium effect: d = 0.5Large effect: d = 0.8

Flexible Group Configurations

# Hosmer-Lemeshow with different group numbers
result_flexible <- desctools(
  data = dca_test_data,
  goodness_of_fit = TRUE,
  fitted_probs = "biomarker_model",
  observed_outcomes = "cardiac_event_numeric",
  hl_groups = 6  # Custom group number
)

print(result_flexible)
## 
##  ADVANCED STATISTICAL TESTS
## 
## character(0)
## 
##  <div style='font-family: Arial, sans-serif;'>
## 
##  Goodness of Fit Tests
## 
##  Hosmer-Lemeshow Goodness of Fit Test
## 
##  <table border='1' cellpadding='5' cellspacing='0'
##  style='border-collapse: collapse;'><tr style='background-color:
##  #f0f0f0; font-weight: bold;'>StatisticValuedfp-valueC
##  Statistic4.604740.3303
## 
##  Interpretation: Good model fit (p > 0.05). The model adequately fits
##  the data.

Summary

The desctools function provides a comprehensive suite of advanced statistical tests essential for clinical research:

Key Features

  • Effect Size Analysis: Quantify practical significance with Cohen’s D and Hedges’ g
  • Model Validation: Assess logistic regression calibration with Hosmer-Lemeshow test
  • Categorical Analysis: Detect trends and dose-response relationships
  • Multiple Testing Control: Maintain statistical rigor across multiple comparisons
  • Clinical Interpretations: Translate statistical results into clinical meaning

Applications

  • Clinical Trials: Effect size analysis for treatment comparisons
  • Diagnostic Studies: Model validation for biomarker research
  • Epidemiological Research: Trend analysis across exposure levels
  • Quality Improvement: Statistical monitoring of clinical processes

Next Steps

  1. Choose appropriate analysis type based on research question
  2. Ensure adequate sample sizes for reliable results
  3. Apply multiple testing correction when appropriate
  4. Focus on clinical interpretation alongside statistical significance
  5. Consider effect sizes and confidence intervals, not just p-values

The desctools function bridges the gap between statistical analysis and clinical application, providing the advanced tools needed for rigorous medical research while maintaining accessibility through clear interpretations and comprehensive output.

References

Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.

Hosmer, D. W., & Lemeshow, S. (2000). Applied logistic regression (2nd ed.). John Wiley & Sons.

Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society, 57(1), 289-300.