knot | R Documentation |
Location of knots from Harrell (2015), Regression Modeling Strategies.
knot(k = 3)
k |
number of knots, must be strictly between 3 and 7. |
Harrell (2015) states that for many datasets, k = 4 offers an adequate fit of the model and is a good compromise between flexibility and loss of pocesion caused by overfitting a small sampleā. If the sample size is small, three knots should be used in order to have enough observations in between the knots to be able to fit each polynomial. If the sample size is large and if there is reason to believe that the relationship being studied changes quickly, more than five knots can be used.
a numeric vector.
Harrell FE (2015). Regression models for continuous y and case study in ordinal regression. In: Harrell FE, ed. Regression Modeling Strategies. New York: Springer.
# Location of 3 knots
knot(3)
# Location of 7 knots
knot(7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.