Learn R Programming

dlnm (version 2.4.7)

integer: Generate a Basis Matrix of Indicator Variables for Integer Values

Description

The function generates a basis matrix including indicator variables defining intervals for integer values. It is meant to be used internally by onebasis and crossbasis and not directly run by the users.

Usage

integer(x, values, intercept=FALSE)

Arguments

x

the predictor variable. Missing values are allowed.

values

the values for which the indicator variables should be computed. Used internally, usually to be left as missing.

intercept

logical. If TRUE, an intercept is included in the basis matrix. See Details below.

Value

A matrix object of class "integer". It contains the attributes values and intercept.

Details

The function returns indicator variables for intervals defined by the integer values within the range of x. It is expressly created to specify an unconstrained function in the space of lags for distributed lag linear (DLMs) or non-linear (DLNMs) models, and probably of no use beyond that.

The argument intercept determines the presence of an intercept. If FALSE, the interval corresponding to the first value in values is excluded, and the parameterization is indentical to dummy variables with the first group as a reference.

See Also

onebasis to generate basis matrices and crossbasis to generate cross-basis matrices.

See dlnm-package for an introduction to the package and for links to package vignettes providing more detailed information.

Examples

Run this code
# NOT RUN {
### simple use (accessing non-exported function through ':::')
dlnm:::integer(1:5)
dlnm:::integer(1:5, intercept=TRUE)
# }

Run the code above in your browser using DataLab