Skip to contents

Comprehensive method comparison analysis including Bland-Altman plots, Passing-Bablok regression, and Deming regression. Essential for validating new laboratory methods, diagnostic tests, and measurement techniques.

Usage

methodcomparison(
  data,
  method1,
  method2,
  grouping,
  comparison_method = "bland_altman",
  confidence_level = 0.95,
  bland_altman_options = TRUE,
  limits_method = "standard",
  proportional_bias = TRUE,
  outlier_detection = TRUE,
  passing_bablok_options = FALSE,
  pb_alpha = 0.05,
  deming_options = FALSE,
  error_ratio = 1,
  correlation_analysis = TRUE,
  concordance_correlation = TRUE,
  regression_comparison = TRUE,
  clinical_limits = FALSE,
  clinical_lower = -10,
  clinical_upper = 10,
  transformation = "none",
  plots_options = TRUE,
  bland_altman_plot = TRUE,
  scatter_plot = TRUE,
  residual_plots = FALSE,
  mountain_plot = FALSE,
  missing_treatment = "complete",
  bootstrap_samples = 1000
)

Arguments

data

The data as a data frame.

method1

.

method2

.

grouping

.

comparison_method

Primary method comparison approach

confidence_level

Confidence level for limits of agreement and regression

bland_altman_options

Enable Bland-Altman specific analysis options

limits_method

Method for calculating limits of agreement

proportional_bias

Test if bias changes with measurement magnitude

outlier_detection

Identify potential outliers in method comparison

passing_bablok_options

Enable Passing-Bablok specific analysis options

pb_alpha

Significance level for Passing-Bablok regression

deming_options

Enable Deming regression specific options

error_ratio

Ratio of error variances (σ²y/σ²x) for Deming regression

correlation_analysis

Include Pearson and Spearman correlation analysis

concordance_correlation

Calculate Lin concordance correlation coefficient for agreement assessment

regression_comparison

Compare ordinary least squares vs method comparison regressions

clinical_limits

Specify clinical acceptability criteria

clinical_lower

Lower bound for clinically acceptable difference

clinical_upper

Upper bound for clinically acceptable difference

transformation

Apply transformation to improve normality

plots_options

Control plot generation and formatting

bland_altman_plot

Generate Bland-Altman plot with limits of agreement

scatter_plot

Scatter plot with regression lines

residual_plots

Generate residual plots for regression diagnostics

mountain_plot

Generate mountain plot (percentile-based differences)

missing_treatment

How to handle missing data

bootstrap_samples

Number of bootstrap samples for confidence intervals

Value

A results object containing:

results$todoa html
results$summarya html
results$descriptiveStatsa table
results$correlationTablea table
results$concordanceTablea table
results$blandAltmanStatsa table
results$passingBablokResultsa table
results$demingResultsa table
results$regressionComparisona table
results$biasAnalysisa table
results$outlierAnalysisa table
results$clinicalAssessmenta table
results$blandAltmanPlotan image
results$scatterPlotan image
results$residualPlotsan image
results$mountainPlotan image
results$methodGuidancea html
results$technicalNotesa html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$descriptiveStats$asDF

as.data.frame(results$descriptiveStats)