logbin.smooth fits log-link binomial
regression models using a stable CEM algorithm. It provides additional
flexibility over logbin by allowing for smooth
semi-parametric terms.logbin.smooth(formula, mono = NULL, data, subset, na.action, offset,
control = list(...), model = TRUE, model.logbin = FALSE, ...)formula"
(or one that can be coerced into that class): a symbolic
description of the model to be fitted. The details of
model specification are given under 'Details'. Note thatformula should be restricted to have a
monotonically non-decreasing relationship with the
outcome. May be specified as names or indices of the
terms.
Note that Iso() terms are as.data.frame to a
data frame) containing the variables in the model. If not
found in data, the variables are NAs. The default is set be the na.action
setting of options, and is logbin.control.logbin
object should be included as a component of the returned value.control argument if it is not supplied directly."logbin.smooth", which contains the same objects as class
"logbin" (the same as "glm" objects, without contrasts,
qr, R or effects components), as well as:model.logbin is TRUE; the logbin object
for the fully parametric model corresponding to the fitted model.interpret.logbin.smooth(formula)
that contains the formula term with any additional arguments to the B
function removed.logbin.smooth performs the same fitting process as logbin,
providing a stable maximum likelihood estimation procedure for log-link
binomial GLMs, with the added flexibility of allowing semi-parametric
B and Iso terms (note that logbin.smooth will stop with an
error if no semi-parametric terms are specified in the right-hand side of the formula;
logbin should be used instead).
The method partitions the parameter space associated with the semi-parametric part of the
model into a sequence of constrained parameter spaces, and defines a fully parametric
logbin model for each. The model with the highest log-likelihood is the MLE for
the semi-parametric model (see Donoghoe and Marschner (2014)).logbin## Simple example
x <- c(0.3, 0.2, 0.0, 0.1, 0.2, 0.1, 0.7, 0.2, 1.0, 0.9)
y <- c(5, 4, 6, 4, 7, 3, 6, 5, 9, 8)
m1 <- logbin.smooth(cbind(y, 10-y) ~ B(x, knot.range = 0:2), mono = 1, trace = 1)
m2 <- logbin.smooth(cbind(y, 10-y) ~ Iso(x))
plot(m1)
plot(m2)
summary(predict(m1, type = "response"))
summary(predict(m2, type = "response"))Run the code above in your browser using DataLab