s_date_Eti: Make Etiology design matrix for dates with R format.

View source: R/utils.R

s_date_EtiR Documentation

Make Etiology design matrix for dates with R format.

Description

s_date_Eti creates design matrices for etiology regressions;

Usage

s_date_Eti(Rdate, Y, basis = "ps", dof = ifelse(basis == "ncs", 5, 10), ...)

Arguments

Rdate

a vector of dates of R format

Y

Binary case/control status; 1 for case; 0 for controls

basis

ncs for natural cubic splines; ps for penalized-splines based on B-spline basis functions (NB: baker does not recommend setting ncs using this function; use splines::ns)

dof

Degree-of-freedom for the bases. For ncs basis, dof is the number of columns; For ps basis, the number of columns is dof if intercept=TRUE; dof-1 if FALSE.

...

Other arguments as in splines::bs()

Value

  • Z_Eti design matrix for etiology regression on dates.

See Also

nplcm()

Examples


data("data_nplcm_reg_nest")
s_date_Eti(data_nplcm_reg_nest$X$DATE,data_nplcm_reg_nest$Y,basis='ps',dof=7)

zhenkewu/baker documentation built on April 26, 2024, 2:35 p.m.