View source: R/make-age-polys.R
dh.makeAgePolys | R Documentation |
When we do trajectory analyses using fractional polynomials we often want to try models with different combinations of age polynomials. This function creates multiple transformations of an age variable to different powers.
dh.makeAgePolys(
df = NULL,
age_var = NULL,
poly_form = c("^-2", "^-1", "^-0.5", "log", "^0.5", "^2", "^3"),
poly_names = c("_m_2", "_m_1", "_m_0_5", "log", "_0_5", "_2", "_3"),
conns = NULL,
checks = TRUE,
agevars = NULL
)
df |
Character specifying a server-side data frame. |
age_var |
Character specifying age variable within 'df' to transform. |
poly_form |
Character vector of powers by which to transform 'age_var'. |
poly_names |
Character vector of names for the created variables. Must the same length and order as 'poly_form'. |
conns |
DataSHIELD connections object. |
checks |
Logical; if TRUE checks are performed prior to running the function. Default is TRUE. |
agevars |
Retired argument name. Please use ‘age_var’ instead. |
Transformations of age are added as columns to server-side object specified in 'df'.
Other trajectory functions:
dh.lmeMultPoly()
,
dh.makeLmerForm()
,
dh.predictLmer()
,
dh.trimPredData()
,
dh.zByGroup()
Other data manipulation functions:
dh.dropCols()
,
dh.makeIQR()
,
dh.makeStrata()
,
dh.quartileSplit()
,
dh.renameVars()
,
dh.tidyEnv()
,
dh.zByGroup()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.