For some sensitivity analyses you may want to examine potential non-linear associations between an exposure and outcome. This function splits a continuous variable into four continuous variables representing each quartile of the original variable. Participants with no measurement within a quartile will be assigned NA.
Usage
dh.quartileSplit(
df = NULL,
var = NULL,
new_obj = NULL,
band_action = NULL,
type = NULL,
var_suffix = "_q_",
conns = NULL
)
Arguments
- df
Character specifying a server-side data frame.
- var
Character specifying continuous variable to transform into quartiles.
- new_obj
Character specifying name for created serverside object.
- band_action
Character specifying how the quartiles are separated:
"g_l" = greater than the lowest band and less than the highest band
"ge_le" = greater or equal to the lowest band and less than or equal to the highest band
"g_le" = greater than the lowest band and less than or equal to the highest band
"ge_l" = greater than or equal to the lowest band and less than the highest band
- type
Character specifying whether to derive quartiles from combined data or within each cohort. Use "combine" to use combined quartiles, and "split" to use cohort-specific quartiles.
- var_suffix
Character specifying the suffix to give the created variable. Default is "q"
- conns
DataSHIELD connections object.
Value
Servside dataframe in containing a maximum of four additional variables representing the quantiles of the original variable. If a cohort has insufficient observations within that quartile (less than the filter threshold) the variable will not be created an a warning will be returned.
See also
Other data manipulation functions:
dh.makeAgePolys()
,
dh.makeIQR()
,
dh.zByGroup()