add_spline_time: Add spline to a standata object

Description Usage Arguments Details Value See Also Examples

View source: R/functions_utils.R

Description

Updates a standata object with a matrix of time or exposure splines

Usage

1
2
3
add_spline_time(standata, Mt)

add_spline_exposure(standata, Mx)

Arguments

standata

the standata object to be updated

Mt, Mx

the matrix of time or exposure splines to be added

Details

add_spline_time updates the Mt, timedf, and Mt_attributes elements of standata. add_spline_exposure updates the Mx, xdf, and Mx_attributes elements of standata.

Value

The standata object with updated elements.

See Also

create_standata_exposure, create_standata_outcome, expsim_update_parameter, outsim_update_parameter, create_spline, create_spline_matrix

Examples

1
2
3
4
5
6
7
8
exp_data <- create_standata_exposure(group=rep(1, 10),
                                     conc=rnorm(10),
                                     unit_id=rep(0:1, 5),
                                     time=runif(10))
exp_data$Mt
Mt <- create_spline_matrix(exp_data$time, df=3, fn="ns")
exp_data <- add_spline_time(exp_data, Mt=Mt)
exp_data$Mt

jpkeller/bercs documentation built on March 24, 2021, 5:36 a.m.