Learn R Programming

FRESA.CAD (version 2.2.0)

baggedModel: Get the bagged model from a list of forward models

Description

This function will take the frequency-ranked of variables and the list of models to create a single bagged model

Usage

baggedModel(modelFormulas, data, type=c("LM","LOGIT","COX"), Outcome=NULL, timeOutcome=NULL, pvalue=0.05, backElimination=FALSE, frequencyThreshold=0.05, removeOutliers=4.0 )

Arguments

modelFormulas
The name of the column in data that stores the variable to be predicted by the model
data
A data frame with two columns. The first one must have the names of the candidate variables and the other one the description of such variables
type
Fit type: Logistic ("LOGIT"), linear ("LM"), or Cox proportional hazards ("COX")
Outcome
The name of the column in data that stores the time to outcome
timeOutcome
The name of the column in data that stores the time to event (needed only for a Cox proportional hazards regression model fitting)
pvalue
The elimination p-value)
backElimination
set it to TRUE if backelimination will be performed at each formula before bagging the coefficients)
frequencyThreshold
set the frequency the thresold of the frequence of features to be included in the model)
removeOutliers
The z value for removing outliers from data set)

Value

bagged.model
the bagged model
formula
the formula of the model
frequencyTable
the table of variables ranked by their model frequency
faverageSize
the average size of the models
zvalues
The average z-values of the model coefficients
reducedDataSet
A data set with the outliers removed
MAD
The mean absolute difference(MAD) of the residuals

See Also

medianPredict