Learn R Programming

logbin (version 1.2)

logbin.smooth.design: Construct Design Matrix for logbin.smooth Model

Description

logbin.smooth.design constructs the design matrix and associated formula for an logbin.smooth model, given a particular parameterisation, to be passed into logbin for fitting.

This is a workhorse function --- it would not normally be called directly.

Usage

logbin.smooth.design(interpret, allref, design.knots, design.param)

Arguments

interpret
the object returned by running interpret.logbin.smooth for the desired model, containing details of the smooth components.
allref
the object returned by running logbin.smooth.allref for the desired model.
design.knots
a vector containing the number of internal knots for each smooth term (NA for Iso terms).
design.param
a vector of indices for a particular parameterisation in allref$allref. Each element corresponds to a smooth term in the model, and the value indicates which item in the associated list is the reference level for this parameterisation.

Value

A list with components:
formula
an updated version of interpret$full.formula, with smooth terms removed and replaced by the names of their associated basis components.
data
an updated version of interpret$data, with columns for the basis functions of the smooth terms added.
monotonic
an updated version of allref$monotonic, such that the coefficients associated with the smooth terms for this parameterisation are constrained to be non-negative.
knots
a list, with one component for each smooth term, containing the knot vector for that term (NA for Iso terms).

Details

For a particular combination of reference levels, logbin.smooth.design constructs the associated design matrix and formula. Specifically, for Iso smooth components, it creates the matrix of indicator covariates for increments between levels. For B smooth components, it creates the basis functions using splineDesign and removing the column associated with the reference level (see Donoghoe and Marschner, 2015).

The formula component is altered to include the terms in the design matrix, and allref$monotonic is altered such that all of the smooth coefficients are restricted to be non-negative, as required.

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, interpret.logbin.smooth, logbin.smooth.allref, logbin.design