plot_mspline {survextrap} | R Documentation |
Plot a M-spline function, showing how it is built up from its basis
Description
See mspline_plotdata
for the data behind the plot
Usage
plot_mspline(
knots = NULL,
bknot = 10,
df = 10,
degree = 3,
bsmooth = TRUE,
coefs = NULL,
scale = 1,
tmin = 0,
tmax = 10,
show_knots = FALSE,
show_means = FALSE
)
Arguments
knots |
Vector of knot locations. If not supplied, The number of knots (excluding zero) is |
bknot |
Location of the final spline knot. |
df |
Desired number of basis terms, or "degrees of freedom"
in the spline. If |
degree |
Spline polynomial degree. Can only be changed from
the default of 3 if |
bsmooth |
If |
coefs |
Coefficients of the spline basis terms. These are normalised internally to sum to 1, if they do not already sum to 1. |
scale |
Scale parameter. After computing the standard M-spline function as a weighted sum of the basis
terms, the function is multiplied by |
tmin |
Minimum plotting time. Defaults to zero. |
tmax |
Maximum plotting time. Defaults to the highest knot. |
show_knots |
Show the positions of the knots, including the upper boundary |
show_means |
Show the "mean" around which each basis term is centred (defined as the mean of a random variable whose PDF is defined by the basis term). |
Value
A ggplot2
plot object.