fit_linear_step {mfp2} | R Documentation |
Function to fit linear model for variable of interest
Description
"Linear" model here refers to a model which includes the variable
of interest xi
with a fp power of 1. Note that xi
may be ACD transformed
if indicated by acdx[xi]
.
For parameter definitions, see find_best_fp_step()
. All parameters
captured by ...
are passed on to fit_model()
.
Usage
fit_linear_step(x, xi, y, powers_current, powers, acdx, ...)
Arguments
x |
an input matrix of dimensions nobs x nvars. Does not contain intercept, but columns are already expanded into dummy variables as necessary. Data are assumed to be shifted and scaled. |
xi |
a character string indicating the name of the current variable of interest, for which the best fractional polynomial transformation is to be estimated in the current step. |
y |
a vector for the response variable or a |
powers_current |
a list of length equal to the number of variables,
indicating the fp powers to be used in the current step for all variables
(except |
powers |
a named list of numeric values that sets the permitted FP powers for each covariate. |
acdx |
a logical vector of length nvars indicating continuous variables to undergo the approximate cumulative distribution (ACD) transformation. |
... |
passed to |
Value
A list with two entries:
-
powers
: fp power(s) ofxi
(or its ACD transformation) in fitted model. -
metrics
: a matrix with performance indices for fitted model.