Learn R Programming

logbin (version 1.0)

logbin.smooth: Smooth Log Binomial Regression

Description

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.

Usage

logbin.smooth(formula, mono = NULL, data, subset, na.action, offset, 
  control = list(...), model = TRUE, model.logbin = FALSE, ...)

Arguments

formula
an object of class "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 that
mono
a vector indicating which terms in formula 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
data
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are
subset
an optional vector specifying a subset of observations to be used in the fitting process.
na.action
a function which indicates what should happen with the data contain NAs. The default is set be the na.action setting of options, and is
offset
this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a non-positive numeric vector of length equal to the number of cases. One or more
control
a list of parameters for controlling the fitting process, passed to logbin.control.
model
a logical value indicating whether the model frame should be included as a component of the returned value.
model.logbin
a logical value indicating whether the fitted logbin object should be included as a component of the returned value.
...
arguments to be used to form the default control argument if it is not supplied directly.

Value

  • An object of class "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.logbinif model.logbin is TRUE; the logbin object for the fully parametric model corresponding to the fitted model.
  • xminmax.smooththe minimum and maximum observed values for each of the smooth terms in the model, to help define the covariate space.
  • full.formulathe component from interpret.logbin.smooth(formula) that contains the formula term with any additional arguments to the B function removed.
  • knotsa named list containing the knot vectors for each of the smooth terms in the model.

Details

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)).

References

Donoghoe, M.W. and I.C. Marschner (2014): "Smooth semi-parametric adjustment of rate differences, risk differences and relative risks," Proceedings of the 29th International Workshop on Statistical Modelling, 1, 105--110. Marschner, I.C. (2014): "Combinatorial EM algorithms," Statistics and Computing, 24, 921--940.

See Also

logbin

Examples

Run this code
## 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