transform_data_step {mfp2} | R Documentation |
Function to extract and transform adjustment variables
Description
Function to extract and transform adjustment variables
Usage
transform_data_step(x, xi, powers_current, df, powers, acdx)
Arguments
x |
a matrix of predictors that includes the variable of interest |
xi |
name of the continuous predictor for which the FP function will be
estimated. There are no binary or two-level variables allowed. All variables
except |
powers_current |
a named list of FP powers of all variables of interest,
including |
df |
a numeric vector of degrees of freedom for |
powers |
a set of allowed FP powers. |
acdx |
a logical vector indicating the use of acd transformation. |
Details
After extracting the adjustment variables this function, using their
corresponding FP powers stored in powers_current
, transforms them.
This is necessary When evaluating x of interest, as we must account for other
variables, which can be transformed or untransformed, depending on the
individual powers. It's worth noting that some powers can be NA, indicating
that the variable has been left out of the adjustment variables. It also
returns the FP data, which is dependent on the degrees of freedom. For example,
df = 2
is equivalent to FP degree one, resulting in the generation of 8
variables. If acdx
for the current variables of interest is set to TRUE
,
however, 64 variables are generated.
When df = 1
, this function returns data unchanged, i.e. a "linear"
transformation with power equal to 1. In case acdx[xi] = TRUE
, the
acd transformation is applied.
Value
A list containing the following elements:
-
powers_fp
: fp powers used fordata_fp
. -
data_fp
: a list with all possible fp transformations forxi
, see thedata
component of the output ofgenerate_transformations_fp()
andgenerate_transformations_acd()
. -
powers_adj
: fp powers for adjustment variables indata_adj
. -
data_adj
: adjustment data, i.e. transformed input data for adjustment variables.