# \#spline

**URL:** https://discourse.datamethods.org/tag/spline/127.md

[Latest](https://discourse.datamethods.org/latest.md) · [Categories](https://discourse.datamethods.org/categories.md) · [Tags](https://discourse.datamethods.org/tags.md)

---

## [RMS Multivariable Modeling Strategies](https://discourse.datamethods.org/t/rms-multivariable-modeling-strategies/4782)

<div class="topic-metadata">

**Author:** [@f2harrell](https://discourse.datamethods.org/u/f2harrell)\
**Replies:** 76\
**Last updated:** [October 28, 2025, 3:39pm UTC](https://discourse.datamethods.org/t/rms-multivariable-modeling-strategies/4782 "2025-10-28T15:39:30Z")

</div>

Regression Modeling Strategies: Multivariable Modeling Strategies This is the fourth of several connected topics organized around chapters in Regression Modeling Strategies. The purposes of these topics are to introduce…

---

## [Choosing Knots for Splines Over Time](https://discourse.datamethods.org/t/choosing-knots-for-splines-over-time/28324)

<div class="topic-metadata">

**Author:** [@tspeidel](https://discourse.datamethods.org/u/tspeidel)\
**Replies:** 3\
**Last updated:** [August 13, 2025, 9:37pm UTC](https://discourse.datamethods.org/t/choosing-knots-for-splines-over-time/28324 "2025-08-13T21:37:06Z")

</div>

I’ve been using restricted cubic splines in my modeling work for quite a while now, and I usually follow Frank’s guidance on the number and placement of knots. That said, I find things get trickier when splines are appl…

---

## [RMS General Regression](https://discourse.datamethods.org/t/rms-general-regression/4705)

<div class="topic-metadata">

**Author:** [@f2harrell](https://discourse.datamethods.org/u/f2harrell)\
**Replies:** 121\
**Last updated:** [May 22, 2025, 6:23pm UTC](https://discourse.datamethods.org/t/rms-general-regression/4705 "2025-05-22T18:23:02Z")

</div>

Regression Modeling Strategies: General Aspects of Fitting Regression Models This is the second of several connected topics organized around chapters in Regression Modeling Strategies. The purposes of these topics are t…

---

## [Interpreting Ordinal Regression with Linear Spline](https://discourse.datamethods.org/t/interpreting-ordinal-regression-with-linear-spline/25385)

<div class="topic-metadata">

**Author:** [@Louis\_Martin](https://discourse.datamethods.org/u/Louis_Martin)\
**Replies:** 1\
**Last updated:** [January 21, 2025, 5:06pm UTC](https://discourse.datamethods.org/t/interpreting-ordinal-regression-with-linear-spline/25385 "2025-01-21T17:06:02Z")

</div>

I’m planning to perform a retrospective analysis to determine whether steroid doses improve outcomes for a subset of NICU patients. The outcome variable will be respiratory interventions at NICU discharge, where outcomes…

---

## [Should I bootstrap Spline term construction?](https://discourse.datamethods.org/t/should-i-bootstrap-spline-term-construction/21804)

<div class="topic-metadata">

**Author:** [@trinhdhk](https://discourse.datamethods.org/u/trinhdhk)\
**Replies:** 10\
**Last updated:** [October 22, 2024, 6:47pm UTC](https://discourse.datamethods.org/t/should-i-bootstrap-spline-term-construction/21804 "2024-10-22T18:47:08Z")

</div>

Dear Professor Harrell, I wonder if we should bootstrap the construction of smoothing splines? I am modelling a logistic model with smoothing term in brms (and mgcv). When performing Bootstrap, a normal replaced resamp…

---

## [Using splines with time series data](https://discourse.datamethods.org/t/using-splines-with-time-series-data/10320)

<div class="topic-metadata">

**Author:** [@MohanG](https://discourse.datamethods.org/u/MohanG)\
**Replies:** 6\
**Last updated:** [May 1, 2024, 1:12pm UTC](https://discourse.datamethods.org/t/using-splines-with-time-series-data/10320 "2024-05-01T13:12:13Z")

</div>

I need to fit a regression model of the form Y = Σₘ(Eₘ Hₘ), where m=1, 2, …, 36 indexes month. Hₘ stands for hours in childcare in month m of life (known) Eₘ measures the impact of an hour of childcare in month m o…

---

## [Interpreting restricted cubic spline contrasts in light of joint null](https://discourse.datamethods.org/t/interpreting-restricted-cubic-spline-contrasts-in-light-of-joint-null/5505)

<div class="topic-metadata">

**Author:** [@lachlan](https://discourse.datamethods.org/u/lachlan)\
**Replies:** 4\
**Last updated:** [April 25, 2022, 3:00am UTC](https://discourse.datamethods.org/t/interpreting-restricted-cubic-spline-contrasts-in-light-of-joint-null/5505 "2022-04-25T03:00:16Z")

</div>

I have modeled the association between a continuous exposure X and a continuous outcome Y using linear regression. The X term is modeled using a restricted cubic spline with 3 degrees of freedom. There are two key quest…

---

## [Diagnostics for regression models with splines](https://discourse.datamethods.org/t/diagnostics-for-regression-models-with-splines/4698)

<div class="topic-metadata">

**Author:** [@Theresac](https://discourse.datamethods.org/u/Theresac)\
**Replies:** 1\
**Last updated:** [August 24, 2021, 3:28pm UTC](https://discourse.datamethods.org/t/diagnostics-for-regression-models-with-splines/4698 "2021-08-24T15:28:20Z")

</div>

I have some regression models in which I used splines. Are there any diagnostics i can run on them and based on what assumptions. I’m assuming they will not carry the same assumptions as the multiple linear regression mo…

---

## [Plotting hazard ratios from spline analysis with an interaction term](https://discourse.datamethods.org/t/plotting-hazard-ratios-from-spline-analysis-with-an-interaction-term/4431)

<div class="topic-metadata">

**Author:** [@Ransy](https://discourse.datamethods.org/u/Ransy)\
**Replies:** 3\
**Last updated:** [May 27, 2021, 6:32pm UTC](https://discourse.datamethods.org/t/plotting-hazard-ratios-from-spline-analysis-with-an-interaction-term/4431 "2021-05-27T18:32:39Z")

</div>

Please, I want to perform an interaction spline analysis for age (continuous) and Quartiles (categorical). My outcome is a survival outcome (incident stroke). The focus is to compare Q4 to Q1 and allow hazard ratio to v…

---

## [Association of continuous outcomes with binary endpoints; and "optimal" cut-off points](https://discourse.datamethods.org/t/association-of-continuous-outcomes-with-binary-endpoints-and-optimal-cut-off-points/4315)

<div class="topic-metadata">

**Author:** [@stat\_guy](https://discourse.datamethods.org/u/stat_guy)\
**Replies:** 3\
**Last updated:** [May 3, 2021, 9:27pm UTC](https://discourse.datamethods.org/t/association-of-continuous-outcomes-with-binary-endpoints-and-optimal-cut-off-points/4315 "2021-05-03T21:27:12Z")

</div>

Hello, everyone. A frequent type of problem that I deal with in my work can be characterized as follows: 1) I have some observational data that is obtained from various hospital records, 2) The primary exposure of intere…

---

## [How to create the real splines values for the rcs and %ia% functions in the rms package?](https://discourse.datamethods.org/t/how-to-create-the-real-splines-values-for-the-rcs-and-ia-functions-in-the-rms-package/4173)

<div class="topic-metadata">

**Author:** [@maikol-solis](https://discourse.datamethods.org/u/maikol-solis)\
**Replies:** 4\
**Last updated:** [March 14, 2021, 4:26pm UTC](https://discourse.datamethods.org/t/how-to-create-the-real-splines-values-for-the-rcs-and-ia-functions-in-the-rms-package/4173 "2021-03-14T16:26:47Z")

</div>

Hi everyone! I have a very basic question but I maybe you could help me. Suppose you have two random variables X1 \<- rnorm(1000) X2 \<- rnorm(1000) and I want to estimate the 3 knot restricted cubic spline for each on…

---

## [Restricted cubic splines (RCS) and standard errors](https://discourse.datamethods.org/t/restricted-cubic-splines-rcs-and-standard-errors/4091)

<div class="topic-metadata">

**Author:** [@MeaghanCuerden](https://discourse.datamethods.org/u/MeaghanCuerden)\
**Replies:** 6\
**Last updated:** [February 3, 2021, 12:50pm UTC](https://discourse.datamethods.org/t/restricted-cubic-splines-rcs-and-standard-errors/4091 "2021-02-03T12:50:39Z")

</div>

Hello, I have a question about the variability of RCS coefficient estimates. I’m working on a simulation study that involves RCS terms. I find that the RCS term coefficient estimates are highly variable. Is there a gain…

---

## [Proper analysis and presentation of the association between a continuous exposure and a binary outcome](https://discourse.datamethods.org/t/proper-analysis-and-presentation-of-the-association-between-a-continuous-exposure-and-a-binary-outcome/3899)

<div class="topic-metadata">

**Author:** [@noambard](https://discourse.datamethods.org/u/noambard)\
**Replies:** 1\
**Last updated:** [November 8, 2020, 10:48pm UTC](https://discourse.datamethods.org/t/proper-analysis-and-presentation-of-the-association-between-a-continuous-exposure-and-a-binary-outcome/3899 "2020-11-08T22:48:20Z")

</div>

Dear colleagues, we would greatly appreciate your assistance with an issue we are facing. We are studying the relationship between a continuous exposure and a binary outcome (to be concrete, a lab test and yes/no severi…

---

## [P for non-linearity for restricted cubic spline model](https://discourse.datamethods.org/t/p-for-non-linearity-for-restricted-cubic-spline-model/3526)

<div class="topic-metadata">

**Author:** [@Sanmei](https://discourse.datamethods.org/u/Sanmei)\
**Replies:** 3\
**Last updated:** [July 9, 2020, 11:11am UTC](https://discourse.datamethods.org/t/p-for-non-linearity-for-restricted-cubic-spline-model/3526 "2020-07-09T11:11:20Z")

</div>

Dear all, I have a problem about P for non-linearity for restricted cubic spline model. we assessed the association between serum biomarker levels and the 10-year risk of events. We found a significant association by c…

---

## [How to determine the age cut-off to be used in prediction model by the restricted cubic spline?](https://discourse.datamethods.org/t/how-to-determine-the-age-cut-off-to-be-used-in-prediction-model-by-the-restricted-cubic-spline/3176)

<div class="topic-metadata">

**Author:** [@Orson](https://discourse.datamethods.org/u/Orson)\
**Replies:** 9\
**Last updated:** [April 6, 2020, 2:31am UTC](https://discourse.datamethods.org/t/how-to-determine-the-age-cut-off-to-be-used-in-prediction-model-by-the-restricted-cubic-spline/3176 "2020-04-06T02:31:23Z")

</div>

I not so fimiliar with this as I used to adopt age as a single continous variable all the time. I am trying to figure out the appropriate knot number and cut-off of age to be used in my model for 6 months mortality. By t…

---

## [Placing knots for restricted cubic splines](https://discourse.datamethods.org/t/placing-knots-for-restricted-cubic-splines/1841)

<div class="topic-metadata">

**Author:** [@sme](https://discourse.datamethods.org/u/sme)\
**Replies:** 21\
**Last updated:** [August 12, 2019, 12:40pm UTC](https://discourse.datamethods.org/t/placing-knots-for-restricted-cubic-splines/1841 "2019-08-12T12:40:56Z")

</div>

I was hoping someone might be able to offer some advice on placing knots for restricted cubic splines. In brief, I am helping a team of clinicians who want to predict which patients require a specialist team to meet them…

---

## [Question about truncating values](https://discourse.datamethods.org/t/question-about-truncating-values/1960)

<div class="topic-metadata">

**Author:** [@Amo89tw](https://discourse.datamethods.org/u/Amo89tw)\
**Replies:** 3\
**Last updated:** [August 7, 2019, 12:04pm UTC](https://discourse.datamethods.org/t/question-about-truncating-values/1960 "2019-08-07T12:04:06Z")

</div>

Hi everyone, I am reading Harrell’s book p74. “…it is beneficial to truncate measurements where the data density ends. In one dataset of 4,000 patients and 2,000 deaths, white blood count ranged from 500 to 100,000 with…
