the data.frame object including the original dataset and the B-spline bases.
Arguments
x
Column names of the covariate of the dataset.
data
Specifies the name of the dataset. This argument is required.
size
Pass on to the df argument in splines::bs(). Degrees of freedom for EACH variable.
degree
Pass on to the degree argument in splines::bs(). Degree of the piecewise polynomial. Default is 3 for cubic splines.
bs_names
Optional. Vecotr of column names of the output B-spline basis matrix. When not specified, a default will be provided.
group
Optional. Column name of the categorical variable of which might have heterogeneous errors among different groups.
split_group
Optional. Whether to split by group proportion for the group with B-spline size if the group argument is provided. If FALSE, then the split will be averaged across all groups. Default is TRUE.
Details
This function can be directly applied for regression model with one or more error-prone continuous covariates.