Produces multiple transformations of the age term for fractional polynomial analyses
Source:R/make-age-polys.R
dh.makeAgePolys.Rd
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. We recommend moving to
dsTidyverseClient::ds.mutate()
which is quicker, although would require a few more lines
of code.
Arguments
- 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.
See also
Other trajectory functions:
dh.lmeMultPoly()
,
dh.makeLmerForm()
,
dh.predictLmer()
,
dh.trimPredData()
,
dh.zByGroup()
Other data manipulation functions:
dh.makeIQR()
,
dh.quartileSplit()
,
dh.zByGroup()