Create design matrix used in sail function

design_sail(x, e, expand, group, basis, nvars, vnames, center.x, center.e)

Arguments

x

input matrix of dimension n x p, where n is the number of subjects and p is number of X variables. Each row is an observation vector. Can be a high-dimensional (n < p) matrix. Can be a user defined design matrix of main effects only (without intercept) if expand=FALSE

e

exposure or environment vector. Must be a numeric vector. Factors must be converted to numeric.

expand

should basis be applied to every column of x (logical). Set to FALSE if you want a user defined main effects design matrix. If FALSE the group membership argument must also be supplied. Default: TRUE.

group

a vector of consecutive integers, starting from 1, describing the grouping of the coefficients. Only required when expand=FALSE.

basis

user defined basis expansion function. This function will be applied to every column in x. Specify function(i) i if no expansion is desired. Default: function(i) splines::bs(i, df = 5).

nvars

number of variables

vnames

variable names

center.x

should the columns of x (after basis expansion) be centered (logical). Default: TRUE.

center.e

should exposure variable e be centered. Default: TRUE.