Function to extract and transform adjustment variables
transform_data_step(x, xi, powers_current, df, powers, acdx)
A list containing the following elements:
powers_fp
: fp powers used for data_fp
.
data_fp
: a list with all possible fp transformations for xi
, see the
data
component of the output of generate_transformations_fp()
and
generate_transformations_acd()
.
powers_adj
: fp powers for adjustment variables in data_adj
.
data_adj
: adjustment data, i.e. transformed input data for adjustment
variables.
a matrix of predictors that includes the variable of interest xi
.
It is assumed that continuous variables have already been shifted and scaled.
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 xi
are referred to as "adjustment variables".
a named list of FP powers of all variables of interest,
including xi
. Note that these powers are updated during backfitting or MFP
cycles.
a numeric vector of degrees of freedom for xi
.
a set of allowed FP powers.
a logical vector indicating the use of acd transformation.
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.