Skip to contents

Compares two rates and returns a text description of their relationship.

Usage

compare_rates(
  ind,
  var,
  rate_data,
  comparison_value,
  rate_type = "mean_cmar",
  digits = 1
)

Arguments

ind

String, indicator name

var

String, variant name

rate_data

data.table containing the provider rate

comparison_value

Either a data.table with comparison rates or a single numeric value

rate_type

String, column name for the rate in rate_data (default: "mean_cmar")

digits

Integer, number of decimal places for comparison (default: 1)

Value

String describing the comparison ("higher than", "lower than", or "the same as")

Examples

if (FALSE) { # \dontrun{
provider_data <- data.table(
  indicator = "antipsychotics",
  variant = "overall",
  mean_cmar = 15.7
)
compare_rates("antipsychotics", "overall", provider_data, 14.2)
} # }