Generates cross-basis matrices for lagged climate variables in a dataset, for use in Distributed Lag Nonlinear Models (DLNM).
set_cross_basis(data, max_lag = 2, nk = 2)A list of cross-basis matrices including the basis matrix for maximum temperature, minimun temperature, cumulative rainfall, and relative humidity.
A dataset returned from combine_health_climate_data(),
including lagged variables like tmax_lag1, tmin_lag1, etc.
Character. Number corresponding to the maximum lag to be considered for the delay effect. It should be between 2 an 4. Defaults to 2.
Numeric. Number of internal knots for the natural spline of
each predictor, controlling its flexibility: nk = 0 produces a linear
effect with one basis column, nk = 1 generates a simple spline with two
columns, nk = 2 yields a more flexible spline with three columns,
and higher values of nk further increase flexibility but may also
raise collinearity among spline terms. Defaults to 1