WEMEL {hlr} | R Documentation |
Logistic regression using weighted maximum estimated likelihood (WEMEL) in order to cope with separation issues and outliers.
WEMEL(x, x1, y, delta=0.01, q=0.75, method="MCD", w=rep(1,length(y)), epsilon = 1e-06, maxit = 100) ## S3 method for class 'WEMEL': print(x, ...) ## S3 method for class 'WEMEL': summary(object, ...) ## S3 method for class 'WEMEL': plot(x, which = c(1, 2), ...)
x |
design matrix (n, p) for function WEMEL ; object of class
'WEMEL' for the print and plot methods |
x1 |
(sub-)matrix of the design matrix. The robust weights are computed
w.r.t. to x1 . E.g. x1 contains only continuous
variables. |
y |
response vector |
delta |
constant |
q |
quantile used for MCD and for the robust weights; defaults to 0.75 |
method |
method to define weights; one of "MCD" (default) or "PCA" |
w |
input vector of weights |
epsilon |
precision constant for the algorithm, default: 1.E-6 |
maxit |
maximum number of iterations for the algorithm; defaults to 100 |
object |
object of class 'WEMEL' |
which |
which plot should be plotted ? An index plot of the robust
weights (which=1 ), the observed response values against
the predicted values (which=2 ) or both (which=c(1, 2) , the
default). |
... |
further arguments to be passed to the methods |
The WEMEL
function fits the WEMEL-model to the data.
The print
method displays the model coefficients.
The summary
method displays the model coefficients and
displays the names of the components of the WEMEL output object.
The plot
function plots either the index plot of the robust
weights (which=1
) or the observed response values against
the predicted values (using the WEMEL linear predictor) on link
scale with a logistic cdf overplotted (which=2
). The
default value (which=c(1, 2)
) plots both.
Object of class 'WEMEL' with following components
WEMEL |
WEMEL estimates of the coefficients |
outWEMEL |
object of class 'glm' corresponding to the final fit |
Tobias Verbeke, largely based on original S-PLUS code by Peter J. Rousseeuw and Andreas Christmann
Rousseeuw, P.J. and Christmann, A. (2003). Robustness against separation and outliers in binary regression. Computational Statistics & Data Analysis, 43, 315 – 332.
Original S-PLUS code available at http://www.stoch.uni-bayreuth.de/de/CHRISTMANN
### Example 1 for function WEMEL: data set has overlap set.seed(314) n <- 500 beta <- matrix(c(3), ncol=1) x <- matrix(rnorm(n), ncol=1) eta <- -2 + x y <- rbinom(nrow(x), 1, plogis(eta)) out <- WEMEL(x, x, y) print(out) summary(out) plot(out) ### Example 2 for function WEMEL: 2 bad leverage points x[499:500] <- c(-10, 10) y[499:500] <- c(1, 0) out <- WEMEL(x, x, y, delta=0.01) out plot(out) ### Example 3 for function WEMEL: data set has no overlap eta <- -2 + x y[eta <= -1] <- 0 y[eta > -1] <- 1 out <- WEMEL(x, x, y, delta=0.01) out plot(out)