Learn R Programming

logbin (version 1.2)

logbin.smooth.allref: Parameterisation for CEM Algorithm with Smooth Terms

Description

A workhorse function for logbin.smooth, logbin.smooth.allref takes the formula and data for a log-link binomial GLM with smooth terms and produces a list of all parameterisations needed for the CEM algorithm associated with the semi-parametric part of the model.

Usage

logbin.smooth.allref(object, data = environment(object), mono, logbin.smooth.spec, num.knots)

Arguments

object
terms object for the "fake.formula" associated with a logbin.smooth model (see interpret.logbin.smooth).
data
a data frame created with get_all_vars for the fake.formula.
mono
a vector indicating which terms in fake.formula should be restricted to have a monotonically non-decreasing relationship with the outcome. May be specified as names or indices of the terms.
logbin.smooth.spec
details of the smooth terms in the formula; this must be in the format returned by interpret.logbin.smooth.
num.knots
a vector containing the number of interior knots to be used for each smooth term in the model (NA for Iso terms).

Value

A list with components:
allref
a named list, with one component for each smooth term in the model. Each component is itself a list, whose components are each of the parameterisations for that term.
terms
the terms component of object.
data
the object passed into the data argument.
monotonic
a named logical vector indicating which components of terms are restricted to be monotonically non-decreasing.

Details

Semi-parametric models in logbin.smooth use an extended CEM algorithm by partioning the parameter space associated with the smooth terms into a collection of restricted parameter spaces, each corresponding to a restricted fully parametric model that can be fit using logbin. This is a workhorse function that creates the list of possible parameterisations of each smooth term.

Isotonic terms and monotonic B-spline terms have only one parameterisation: where the maximum fitted value occurs at the maximum of the covariate range.

Unrestricted B-spline terms each have $k + 3$ parameterisations (where $k$ is the number of internal knots), corresponding to the possible locations of the maximum of the smooth curve along the range of the covariate.

logbin.smooth considers all possible combinations of the number of knots for each smooth term, and all possible combinations of the associated parameterisations, and logbin.smooth.design creates the appropriate formula and design matrix to be used in the call to logbin.

References

Donoghoe, M. W. and I. C. Marschner (2015). Flexible regression models for rate differences, risk differences and relative risks. International Journal of Biostatistics 11(1): 91--108.

See Also

logbin.smooth