Create design matrix used in sail
function
design_sail(x, e, expand, group, basis, nvars, vnames, center.x, center.e)
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
exposure or environment vector. Must be a numeric vector. Factors must be converted to numeric.
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
.
a vector of consecutive integers, starting from 1, describing
the grouping of the coefficients. Only required when expand=FALSE
.
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)
.
number of variables
variable names
should the columns of x
(after basis expansion) be
centered (logical). Default: TRUE
.
should exposure variable e
be centered. Default:
TRUE
.