x
.rcspline.eval(x, knots, nk=5, inclx=FALSE, knots.only=FALSE,
type="ordinary", norm=2, rpm=NULL)
x
. For 3-5 knots, the outer quantiles used are .05 and .95.
For nk>5
, the outer quantiles are .025 and .975. The knots are
equally spaced between thTRUE
to add x
as the first column of the returned matrix"ordinary"
to fit the function, "integral"
to fit its anti-derivative.0
to use the terms as originally given by Devlin and Weeks (1986),
1
to normalize non-linear terms by the cube of the spacing between the last two
knots, 2
to normalize by the square of the spacing between the first
x
will be replaced with the value rpm
after
estimating any knot locations.knots.only=TRUE
, returns a vector of knot locations. Otherwise returns
a matrix with x
(if inclx=TRUE
) followed by nk-2
nonlinear terms.
The matrix has an attribute knots
which is the vector of knots used.ns
, rcspline.restate
, rcs
x <- 1:100
rcspline.eval(x, nk=4, inclx=TRUE)
#lrm.fit(rcspline.eval(age,nk=4,inclx=TRUE), death)
Run the code above in your browser using DataLab