Learn R Programming

logbin (version 1.0)

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 parameterization, 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 parameterization 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 parameterizatio

Value

  • A list with components:
  • formulaan updated version of interpret$full.formula, with the smooth terms removed and replaced by the names of their associated basis components.
  • dataan updated version of interpret$data, with columns for the basis functions of the smooth terms added.
  • monotonican updated version of allref$monotonic, such that the coefficients associated with the smooth terms for this parameterization are constrained to be non-negative.
  • knotsa 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 (2014)). 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 (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.

See Also

logbin.smooth, interpret.logbin.smooth, logbin.smooth.allref, logbin.design