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". The model must contain an intercept
and at least one semi-parametric term, included by using the
B
or Iso
functions. Note that 2nd-order terms
(such as interactions) or above are not currently supported
(see logbin
).
formula
should be restricted to have a
monotonically non-decreasing relationship with the
outcome. May be specified as names or indices of the
terms.
Iso()
terms are always monotonic.
as.data.frame
to a
data frame) containing the variables in the model. If not
found in data
, the variables are taken from
environment(formula)
, typically the environment
from which logbin.smooth
is called.
NA
s. The default is set be the na.action
setting of options
, and is na.fail
if that is unset. The `factory-fresh' default is na.omit
.
Another possible value is NULL
, no action. Value
na.exclude
can be useful.
NULL
or a
non-positive numeric vector of length equal to the number of cases.
One or more offset
terms can be included in
the formula instead or as well, and if more than one is
specified their sum is used. See
model.offset
.
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, 2015).
Marschner, I. C. (2014). Combinatorial EM algorithms. Statistics and Computing 24(6): 921--940.
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