powered by
Wrapper around splines::ns() with default Boundary.knots of c(0, max(time)).
splines::ns()
Boundary.knots
c(0, max(time))
time_spline_basis(time, df, Boundary.knots = c(0, max(time)), ...)
A matrix of dimension length(time) * df. See the Value section of splines::ns().
length(time) * df
Continuous time variable, passed directly to splines::ns() as the first argument.
Degrees of freedom, passed directly to the df argument of splines::ns().
df
Boundary knots, passed directly to the Boundary.knots argument of splines::ns(). Defaults to c(0, max(time)).
Passed to splines::ns().
time_spline() is primarily useful because it can create the spline basis from time and then re-input time into the spline basis to obtain the predictions in one step. Or, it can calculate predictions from a basis supplied to the basis argument.
time_spline()
time
basis
time_spline_basis(Theoph$Time, df = 3)
Run the code above in your browser using DataLab