bp_arv {bp}R Documentation

Average Real Variability (ARV)


Calculate the Average Real Variability (ARV) at various levels of granularity based on what is supplied (ID, VISIT, WAKE, and / or DATE). ARV is a measure of dispersion that takes into account the temporal structure of the data and relies on the sum of absolute differences in successive observations, unlike the successive variation (SV) which relies on the sum of squared differences.


  inc_date = FALSE,
  subj = NULL,
  bp_type = c("both", "sbp", "dbp"),
  add_groups = NULL,
  inc_wake = TRUE



Required argument. Pre-processed dataframe containing SBP and DBP with optional ID, VISIT, WAKE, and DATE columns if available. Use process_data to properly format data.


Optional argument. Default is FALSE. As ABPM data typically overlaps due to falling asleep on one date and waking up on another, the inc_date argument is typically kept as FALSE, but the function will work regardless. Setting inc_date = TRUE will include these dates as a grouping level.


Optional argument. Allows the user to specify and subset specific subjects from the ID column of the supplied data set. The subj argument can be a single value or a vector of elements. The input type should be character, but the function will comply with integers so long as they are all present in the ID column of the data.


Optional argument. Determines whether to calculate ARV for SBP values or DBP values, or both. For both SBP and DBP ARV values use bp_type = 'both', for SBP-only use bp_type = 'sbp, and for DBP-only use bp_type = 'dbp'. If no type specified, default will be set to 'both'


Optional argument. Allows the user to aggregate the data by an additional "group" to further refine the output. The supplied input must be a character vector with the strings corresponding to existing column names of the processed data input supplied. Capitalization of add_groups does not matter. Ex: add_groups = c("Time_of_Day")


Optional argument corresponding to whether or not to include WAKE in the grouping of the final output (if WAKE column is available). By default, inc_wake = TRUE which will include the WAKE column in the groups by which to calculate the respective metrics.


A tibble object with a row corresponding to each subject, or alternatively a row corresponding to each date, if inc_date = TRUE. The resulting tibble consists of:


Mena et al. (2005) A reliable index for the prognostic significance of blood pressure variability Journal of Hypertension 23(5).505-11, doi: 10.1097/01.hjh.0000160205.81652.5a.


# Load data

# Process bp_hypnos
hyp_proc <- process_data(bp_hypnos, sbp = "SYST", dbp = "DIAST", date_time = "date.time",
id = "id", wake = "wake", visit = "visit", hr = "hr", pp ="pp", map = "map", rpp = "rpp")
# Process bp_jhs data
jhs_proc <- process_data(bp_jhs, sbp = "Sys.mmHg.", dbp = "Dias.mmHg.", date_time = "DateTime",
hr = "Pulse.bpm.")

# ARV Calculation
bp_arv(hyp_proc, add_groups = c("SBP_Category"), bp_type = 'sbp')
bp_arv(jhs_proc, inc_date = TRUE)

[Package bp version 2.1.0 Index]