Given a model and a new data set, this function will return the residuals of the predicted values. When dealing with a Cox proportional hazards regression model, the function will return the Martingale residuals.
residualForFRESA(object,
testData,
Outcome,
eta = 0.05)
A vector with the residuals (i.e. the differences between the predicted and the real outcome)
An object of class lm
, glm
, or coxph
containing the model to be analyzed
A data frame where all variables are stored in different columns, with the data set to be predicted
The name of the column in data
that stores the variable to be predicted by the model
The weight of the contribution of the Martingale residuals, or 1 - the weight of the contribution of the classification residuals (only needed if object
is of class coxph
)
Jose G. Tamez-Pena and Antonio Martinez-Torteya