fit_mfp {mfp2} | R Documentation |
Function for fitting a model using the MFP or MFPA algorithm
Description
This function is not exported and is intended to be called from
the mfp2()
function. While most parameters are explained in
the documentation of mfp2()
, their form may differ in this
function. Note that this function does not check its arguments
and expects that its input has been prepared in mfp2()
function.
Usage
fit_mfp(
x,
y,
weights,
offset,
cycles,
scale,
shift,
df,
center,
family,
criterion,
select,
alpha,
keep,
xorder,
powers,
method,
strata,
nocenter,
acdx,
ftest,
control,
verbose
)
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. |
y |
a vector for the response variable or a |
weights |
a vector of observation weights of length nobs. |
offset |
a vector of length nobs of offsets. |
cycles |
an integer representing the maximum number of iteration cycles during which FP powers for all predictor are updated. |
scale |
a numeric vector of length nvars of scaling factors. Not applied,
but re-ordered to conform to |
shift |
a numeric vector of length nvars of shifts. Not applied,
but re-ordered to conform to |
df |
a numeric vector of length nvars of degrees of freedom. |
center |
a logical vector of length nvars indicating if variables are to be centered. |
family |
a character string representing a family object. |
criterion |
a character string defining the criterion used to select variables and FP models of different degrees. |
select |
a numeric vector of length nvars indicating significance levels for backward elimination. |
alpha |
a numeric vector of length nvars indicating significance levels for tests between FP models of different degrees. |
keep |
a character vector with names of variables to be kept in the model. |
xorder |
a string determining the order of entry of the covariates into the model-selection algorithm. |
powers |
a named list of numeric values that sets the permitted FP powers for each covariate. |
method |
a character string specifying the method for tie handling in Cox regression model. |
strata |
a factor of all possible combinations of stratification
variables. Returned from |
nocenter |
a numeric vector with a list of values for fitting Cox
models. See |
acdx |
a logical vector of length nvars indicating which continuous variables should undergo the approximate cumulative distribution (ACD) transformation. |
ftest |
a logical indicating the use of the F-test for Gaussian models. |
control |
a list with parameters for model fit. See |
verbose |
a logical; run in verbose mode. |
Value
See mfp2()
for details on the returned object.
Algorithm
Step 1: order variables according to
xorder
. This step may involve fitting a regression model to determine order of significance.Step 2: input data pre-processing. Setting initial powers for fractional polynomial terms, checking if acd transformation is required and allowed. Note that the initial powers of all variables are always set to 1, and higher FPs are only evaluated in turn for each variables in the first cycle of the algorithm. See e.g. Sauerbrei and Royston (1999).
Step 3: run mfp algorithm cycles. See
find_best_fp_cycle()
for more details.Step 4: fit final model using estimated powers.
References
Sauerbrei, W. and Royston, P., 1999. Building multivariable prognostic and diagnostic models: transformation of the predictors by using fractional polynomials. J Roy Stat Soc a Sta, 162:71-94.