Skip to contents

This function scales variables by their interquartile range. IQR is calulcated either within cohort or using the combined IQR across cohorts. The formula used is: value_subject / (75th percentile - 25th percentile).

Usage

dh.makeIQR(
  df = NULL,
  vars = NULL,
  type = c("combine", "split"),
  new_obj = df,
  conns = NULL,
  checks = TRUE,
  new_df_name = NULL
)

Arguments

df

Character specifying a server-side data frame.

vars

Character vector of columns within df to transform.

type

Use "combine" to transform the variable based on the combined IQR across all cohorts specified in conns, or "split" to transform based on the within-cohort IQR.

new_obj

Character specifying name for created serverside object.

conns

DataSHIELD connections object.

checks

Logical; if TRUE checks are performed prior to running the function. Default is TRUE.

new_df_name

Retired argument. Please use `new_obj' instead.

Value

Server-side object specified in df with transformed variables added as columns. Variables have suffix "_iqr_c" if type is "combine", or "_iqr_s" if type is "split".

See also

Other data manipulation functions: dh.makeAgePolys(), dh.quartileSplit(), dh.zByGroup()