Fits a logistic ridge regression model. Optionally, the ridge regression parameter is chosen automatically using the method proposed by Cule et al (2012).
logisticRidge(formula, data, lambda = "automatic", nPCs = NULL,
scaling = c("corrForm", "scale", "none"), ...)# S3 method for ridgeLogistic
coef(object, all.coef = FALSE, ...)
# S3 method for ridgeLogistic
plot(x, y = NULL, ...)
# S3 method for ridgeLogistic
predict(object, newdata = NULL, type = c("link", "response"),
na.action = na.pass, all.coef = FALSE, ...)
# S3 method for ridgeLogistic
print(x, all.coef = FALSE, ...)
# S3 method for ridgeLogistic
summary(object, all.coef = FALSE, ...)
# S3 method for summary.ridgeLogistic
print(x, digits = max(3, getOption("digits") - 3),
signif.stars = getOption("show.signif.stars"), ...)
a formula expression as for regression models, of the form response ~ predictors
. See the
documentation of formula
for other details.
an optional data frame in which to interpret the variables occuring in formula
.
A ridge regression parameter. If lambda
is "automatic"
(the default), then the ridge parameter
is chosen automatically using the method of Cule et al (2012).
The number of principal components to use to choose the ridge regression parameter, following the method of
Cule et al (2012). It is not possible to specify both lambda
and nPCs
.
The method to be used to scale the predictors. One of
"corrform"
(the default) scales the predictors to correlation form, such that the correlation matrix
has unit diagonal.
"scale"
Standardizes the predictors to have mean zero and unit variance.
"none"
No scaling.
A ridgeLogistic object, typically generated by a call to linearRidge
.
An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.
the type of prediction required. The default predictions are of log-odds
(probabilities on logit scale) and type = "response"
gives
the predicted probabilities.
function determining what should be done with missing values
in newdata
. The default is to predict NA
.
Logical. Should results be returned for all ridge regression penalty
parameters (all.coef = TRUE
), or only for the ridge parameter chosen automatically using the method of Cule et al?
An object of class ridgeLogistic
(for the
print.ridgeLogistic
and plot.ridgeLogistic
functions) or an object of class
summary.ridgeLogistic
(for the print.summary.ridgeLogistic
function)
Dummy argument for compatibility with the default plot
method. Ignored.
minimum number of significant digits to be used for most numbers
logical; if TRUE
, P-values are additionally encoded
visually as significance stars
in order to help scanning of
long coefficient tables. It defaults to the
show.signif.stars
slot of options
.
Additional arguments to be passed to or from other methods.
An object of class "ridgeLogistic"
, with components:
Was lambda
chosen automatically?
The matched call.
A named vector of fitted coefficients.
A vector of degrees of freedom of the model fit and degrees of freedom for variance.
Was in antercept included?
Were the predictors scaled before the model was fitted?
The ridge regression parameter.
The scales used to standardize the predictors.
The terms
object used.
The scaled predictor matrix.
A vector of means of the predictors.
The response.
The number of principal components used to compute the ridge regression parameter.
If an intercept is present in the model, its coefficient is not penalised. If you want to penalise an intercept, put in your own constant term and remove the intercept.
A semi-automatic method to guide the choice of ridge parameter in ridge regression. Cule, E. and De Iorio, M. (2012) arXiv:1205.0686v1 [stat.AP]
# NOT RUN {
data(GenBin)
mod <- logisticRidge(Phenotypes ~ ., data = as.data.frame(GenBin))
summary(mod)
# }
Run the code above in your browser using DataLab