View source: R/quartile-split.R
dh.quartileSplit | R Documentation |
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.
dh.quartileSplit(
df = NULL,
var = NULL,
new_obj = NULL,
band_action = NULL,
type = NULL,
var_suffix = "_q_",
conns = NULL
)
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:
|
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. |
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.
Other data manipulation functions:
dh.makeAgePolys()
,
dh.makeIQR()
,
dh.zByGroup()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.