sm.conv {bcgam} | R Documentation |
Specify a smooth and convex shape-restriction in a bcgam formula
Description
A symbolic routine to define that the systematic component \eta
is
smooth and convex with respect to a predictor in a bcgam formula.
Usage
sm.conv(x, numknots = 0, knots = 0, space = "Q")
Arguments
x |
a numeric predictor of length |
numknots |
number of knots used to constrain |
knots |
knots used to constrain |
space |
a character specifying the method to create knots. It is ignored when the |
Details
sm.conv
returns the vector x
and assigns five attributes to it: name, shape (3 for
"smooth and convex"), numknots, knots and space.
This routine does not create the splines basis vectors by itself.
Value
x |
the numeric predictor |
Author(s)
Cristian Oliva-Aviles and Mary C. Meyer
References
Meyer, M. C. (2008) Inference using shape-restricted regression splines. Annals of Applied Statistics 2(3), 1013-1033.
Examples
data(duncan)
prestige <- duncan$prestige
# specify knots
sm.conv(prestige, knots=c(3,9,30,57,86,97))
# specify number of knots
prestige.smconv <- sm.conv(prestige, numknots=7)
# check attributes
attributes(prestige.smconv)