# https://github.com/r-lib/pkgdown/issues/2704

Skip to contents

A function used to calculate the patient's pain index. This is used to calculate the likelihood of severe coronary artery disease in the Duke Clinical Score 1993 paper.

Usage

calculate_dcs_1993_pain_index(
  have_typical_chest_pain,
  frequency_of_angina_pain_per_week,
  have_progressive_angina,
  have_nocturnal_angina,
  have_q_waves,
  have_st_t_changes,
  max_na = 0,
  max_frequency_of_angina_pain_per_week = 35
)

Arguments

have_typical_chest_pain

Input characters (no, yes) to indicate if the patient has typical chest pain.

  • no stands for not having typical chest pain.

  • yes stands for having typical chest pain.

frequency_of_angina_pain_per_week

Input integer to indicate the patient's frequency of angina per week.

have_progressive_angina

Input characters (no, yes) to indicate if the patient has progressive angina.

  • no stands for not having progressive angina.

  • yes stands for having progressive angina.

have_nocturnal_angina

Input characters (no, yes) to indicate if the patient has nocturnal angina.

  • no stands for not having nocturnal angina.

  • yes stands for having nocturnal angina.

have_q_waves

Input characters (no, yes) to indicate if the patient has Q waves on electrocardiogram (ECG).

  • no stands for the patient not having Q waves on ECG.

  • yes stands for the patient having Q waves on ECG.

have_st_t_changes

Input characters (no, yes) to indicate if the patient has ST-T changes on electrocardiogram (ECG).

  • no stands for the patient not having ST-T changes on ECG.

  • yes stands for the patient having ST-T changes on ECG.

max_na

Input integer 0 to 6 to indicate the maximum number of missing symptoms to tolerate before outputting an NA. Default: 0

max_frequency_of_angina_pain_per_week

Input non-negative integer to indicate the maximum frequency angina per week to tolerate before outputting an NA. In the Duke Clinical Score 1993 paper, the maximum value is set as 35. Default: 35

Value

An integer indicating the patient's pain index. It can also be NA if the number of missing symptoms exceeds the max_na input value or the frequency of angina per week exceed the max_frequency_of_angina_pain_per_week input value.

Examples

calculate_dcs_1993_pain_index(
  have_typical_chest_pain = "yes",
  frequency_of_angina_pain_per_week = 10,
  have_progressive_angina = "yes",
  have_nocturnal_angina = "no",
  have_q_waves = "no",
  have_st_t_changes = "no",
  max_na = 0,
  max_frequency_of_angina_pain_per_week = 35
)
#> [1] 10

calculate_dcs_1993_pain_index(
  have_typical_chest_pain = "yes",
  frequency_of_angina_pain_per_week = 10,
  have_progressive_angina = "yes",
  have_nocturnal_angina = NA,
  have_q_waves = "no",
  have_st_t_changes = "no",
  max_na = 0,
  max_frequency_of_angina_pain_per_week = 35
)
#> [1] NA

calculate_dcs_1993_pain_index(
  have_typical_chest_pain = "yes",
  frequency_of_angina_pain_per_week = 10,
  have_progressive_angina = "yes",
  have_nocturnal_angina = NA,
  have_q_waves = "no",
  have_st_t_changes = "no",
  max_na = 1,
  max_frequency_of_angina_pain_per_week = 35
)
#> [1] 10

calculate_dcs_1993_pain_index(
  have_typical_chest_pain = "yes",
  frequency_of_angina_pain_per_week = 40,
  have_progressive_angina = "yes",
  have_nocturnal_angina = "no",
  have_q_waves = "no",
  have_st_t_changes = "no",
  max_na = 0,
  max_frequency_of_angina_pain_per_week = 35
)
#> [1] NA

calculate_dcs_1993_pain_index(
  have_typical_chest_pain = "yes",
  frequency_of_angina_pain_per_week = 40,
  have_progressive_angina = "yes",
  have_nocturnal_angina = "no",
  have_q_waves = "no",
  have_st_t_changes = "no",
  max_na = 0,
  max_frequency_of_angina_pain_per_week = NA
)
#> [1] 40