genspline: Generates spline basis matrices for fitting to dose-response...

Description Usage Arguments

View source: R/prepare.functions.R

Description

Generates spline basis matrices for fitting to dose-response function

Usage

1
genspline(x, spline = "rcs", knots = 3, ord = 4, max.dose = max(x))

Arguments

x

A numeric vector indicating all doses of an agent available in the dataset (including placebo)

spline

Indicates the type of spline function. Can be either natural cubic spline ("ns"), restricted cubic spline ("rcs") or B-spline ("bs").

knots

The number/location of knots if a restricted cubic spline dose-response function is fitted (fun="rcs"). If a single number is given it indicates the number of knots (they will be equally spaced across the range of doses). If a numeric vector is given it indicates the location of the knots. Minimum number of knots is 3.

ord

a positive integer giving the order of the spline function. This is the number of coefficients in each piecewise polynomial segment, thus a cubic spline has order 4. Defaults to 4.

max.dose

A number indicating the maximum dose between which to calculate knot points.


MBNMAdose documentation built on Sept. 13, 2020, 5:08 p.m.