Is the J-Shape Real? Shape-Restricted Tests for Spline Dose–Response Curves

Clinical studies often claim that risk follows a U- or J-shaped curve in some biomarker: mortality rises at both low and high values, with a "sweet spot" in between. These claims usually rest on a restricted cubic spline, a smooth piecewise-cubic curve forced to be straight beyond its outermost breakpoints, placed inside a Cox survival model. The reported evidence is a plot plus a "P for nonlinearity". That p-value tests whether the curve is a straight line. It does not test whether the curve is non-monotone, which is the actual claim. Unconstrained splines bend easily in sparse tails, so a curve that truly rises monotonically can show a spurious dip at low values. This note proposes a direct test: fit the spline twice, once freely and once under the hard constraint that risk never decreases, and compare the two likelihoods with a properly calibrated likelihood-ratio test.

The constrained fit is a convex problem with infinitely many constraints, because the slope must be non-negative at every point of the exposure range. We solve it with iterative constraint generation. The method solves with a few constraints, finds the point where the current curve is most decreasing, adds that one constraint, and repeats. For restricted cubic splines the search for that point is exact and cheap: the slope is a quadratic between breakpoints and a constant in the tails, so its minimum has a closed form. The contribution is mainly statistical, namely a test, calibration and reanalysis protocol for J-shape claims. The optimization is the engine that makes the many required refits exact and fast.

Core Claim

A shape-restricted likelihood-ratio test should accompany every reported U/J/L-shaped spline association. The test compares a monotone-constrained restricted cubic spline Cox fit against the unconstrained fit, restricted to a pre-declared support interval, and is calibrated by bootstrap refits from the constrained null. It controls false "J-shape" findings where visual inspection and linearity tests do not, and it keeps power against genuine non-monotonicity. The specific new pieces are three. The first is an exact separation oracle for spline derivative constraints in the survival setting. The second is a bootstrap calibration for the resulting test, whose null distribution is a mixture of chi-squared laws because the null lies on a cone boundary. The third is a reanalysis of published MIMIC-IV stress-hyperglycemia J-shapes.

Concretely, with spline coefficients $\beta$, basis functions $B(x)$, adjustment covariates $z$ with coefficients $\gamma$, and Cox partial log-likelihood $\ell$, the null fit solves

$$\max_{\beta,\gamma}\ \ell(\beta,\gamma) \quad \text{s.t.}\quad \beta^\top B'(x) \ge 0 \ \ \text{for all } x \in [a,b],$$

where $[a,b]$ is the declared support range, for example the 2.5th to 97.5th exposure percentiles. The test statistic is $T = 2(\hat\ell_{\text{free}} - \hat\ell_{\text{mono}})$. Each cut $\beta^\top B'(x^\ast) \ge 0$ is linear in $\beta$, so every iteration is a smooth concave maximization with a handful of linear constraints.

Relation to Prior Work

The closest existing work is An algorithm for a constrained P-spline. It enforces non-negativity of a penalized B-spline in least squares by adding constraint points at estimated crossings, found by a first-order Taylor step, and pruning slack ones. A Lipschitz bound then certifies the result afterwards. It reports TP1 RMSE of $1.02\times10^{-4}$ against $5.04\times10^{-4}$ for non-negative coefficients, and 1.069 s against 6.397 s for a dense second-order-cone fit on COVID-19 counts. That paper supplies our solver pattern. We differ in four ways. We constrain the derivative rather than the level. We use restricted cubic bases with linear tails. Our oracle is exact, so no Lipschitz certificate is needed. We optimize a censored survival likelihood. Most importantly, our object is a hypothesis test, not a smoother.

Hard Shape-Constrained Kernel Machines guarantees continuous shape constraints by enforcing them on a fixed grid with a safety margin. It constrains our design: margins are one valid route to exact feasibility, and we instead obtain exactness from the closed-form cubic structure. Efficient Second-Order Shape-Constrained Function Fitting gives near-linear dynamic programs, but only under maximum-error loss and for piecewise-linear fits. It explicitly cannot place an unknown peak, so it cannot serve a likelihood-based test.

On the statistics side, three papers motivate the work. Impact of stress hyperglycemia ratio on mortality in patients with critical acute myocardial infarction reports a J-shape with nadir near SHR 1.02–1.04 in MIMIC-IV and CIN-II, with a diabetes interaction p of 0.101 in one cohort and 0.008 in the other. Association between stress hyperglycemia ratio and all-cause mortality in critically ill patients with atrial fibrillation reports a Q4 vs Q1 hazard ratio of 1.32 (95% CI 1.06–1.65). Prognostic value of triglyceride-glucose index reports a threshold near TyG 9.0. All three fit unconstrained splines and validate with discrimination statistics. That practice is exactly what Position: Stop Chasing the C-index criticizes. Survival regression with proper scoring rules and monotonic neural networks shows that the right-censored log-likelihood is proper while the C-index and Brier-type scores are not. We therefore evaluate on held-out log-likelihood. We use its monotone network, SuMo-net, only as a flexible reference, because it is monotone in time, not in an exposure, and yields no interpretable nadir.

Research Program

Solver. The solver alternates Newton steps on the Cox partial likelihood under the current linear cuts with an oracle call. On each inter-knot interval, the oracle minimizes the quadratic slope, checking the endpoints and the vertex. It checks the constant slopes in the two linear tails, returns the most negative point, and adds a cut. Cuts that have been slack for several rounds are pruned, as in the constrained P-spline method. Semi-infinite convex programs of this kind converge to tolerance rather than in finitely many steps. We therefore cut at margin $\epsilon$, i.e. $\beta^\top B'(x^\ast)\ge\epsilon$, and stop when the exact oracle reports the minimum slope is at least zero. The stopping test is then itself an exact feasibility certificate.

Model extensions. The same loop handles several constrained terms at once: a monotone spline in the exposure alongside unconstrained adjustment splines. It also handles subgroup-specific curves, such as separate SHR curves for diabetics and non-diabetics, each with its own oracle. Saturation (L-shape) claims become a second null: monotone and concave above a declared point, tested with the same machinery and a second-derivative oracle that is linear per interval.

Calibration. The statistic $T$ does not follow a standard chi-squared law under the null. We calibrate it by parametric bootstrap from the constrained fit, simulating event times from the fitted baseline hazard and resampling censoring, with 1,000–2,000 refits per test. Exact, warm-started refits are what make this practical.

Sensitivity analyses. The protocol requires the support interval and knot count, three to five knots at Harrell's default quantiles, to be declared in advance. It reports the test across these choices, since tail truncation is exactly where spurious dips live. It also reports where the constraint binds in the null fit. That location shows which part of the curve the J-shape depends on.

Baselines

The naive reference is current practice. That means an unconstrained restricted cubic spline Cox model with the linearity test, with a "J-shape" declared when the fitted curve has an interior minimum and the linearity p-value is below 0.05. We run it on identical data, knots and covariates. Beating it means substantially lower false J-shape rates under monotone truth at matched or better power. No reported result for false-shape rates was found on Lacuna, so this is measured here.

The strongest test competitor is a one-sided slope test at the estimated nadir's lower side. It asks whether the pointwise confidence interval for the slope below the fitted minimum excludes zero. This is what a careful epidemiologist would do. It runs on the same fits, and beating it means nominal type I error where it is anti-conservative because the nadir is chosen after seeing the data.

The strongest solver competitor is the exact sum-of-squares or second-order-cone formulation of "a quadratic is non-negative on an interval", solved by a conic solver with exponential-cone support for the Cox likelihood. A dense-grid version with 1,000 linear constraints is also included. Both receive the same data, tolerance $10^{-8}$, warm starts and hardware. Beating them means equal objective values, which is required, at lower wall-clock per bootstrap replicate. If they tie, the solver is an implementation choice and we will say so. The nearest cited timing is 1.069 s against 6.397 s for iterative against dense-cone smoothing in An algorithm for a constrained P-spline, but that comes from a different problem.

The ablation replaces our exact oracle with the Taylor-step feeding rule from that same paper. This isolates whether exactness changes iteration counts or residual violations.

For predictive adequacy, monotone and unconstrained splines are compared with SuMo-net on held-out right-censored log-likelihood. No reported SHR-cohort log-likelihood was found on Lacuna for SuMo-net.

Why not just…?

Why not just use a dense grid of constraints? For a single five-coefficient spline, a dense grid is cheap and nearly exact. This is a real threat to any speed claim, and we do not rest the contribution on it. The grid gives an outer approximation that can leave tiny violations between points, slightly biasing the null likelihood upward. With several constrained subgroup curves and 2,000 bootstrap refits, the per-fit cost adds up. The solver experiment reports both effects. If they are negligible, the test and calibration remain the contribution and the grid becomes an accepted implementation.

Why not just use the exact sum-of-squares formulation? It is exact and small, and it is the serious alternative. Its drawback is practical: it needs a conic solver supporting the Cox likelihood, which standard survival software lacks. Constraint generation, by contrast, reuses an ordinary Newton–Raphson Cox routine with linear constraints, and it directly reports where the constraint binds. The head-to-head timing and objective-match experiment settles whether this matters.

Why not just read the confidence band or test the slope near the nadir? The nadir location is chosen from the same data, so a pointwise test at it is a post-selection test. The simulation study quantifies its type I error directly against the global likelihood-ratio test.

Why not just use isotonic or monotone neural survival models? They estimate a monotone curve but give no test of monotone against non-monotone. They also lack the parametric spline form that clinical reporting of nadirs and hazard ratios relies on, as in Impact of stress hyperglycemia ratio. We include SuMo-net only as a likelihood reference.

Proposed Experiments

Simulation. Exposure distributions are matched to SHR's right-skew with a sparse low tail. Truths are monotone increasing, monotone with a flat region, and genuinely J-shaped with varying depth. Sample sizes are 1,000–3,000 and censoring is 25–40%, bracketing the reported cohort sizes and mortality (2,166 patients, 23.8% mortality in Impact of stress hyperglycemia ratio). We report false J-shape rates, power curves, coverage of the nadir and its sensitivity to knots and support interval. The decisive check is whether current practice exceeds 5% false J-shapes under monotone truth while our test stays near nominal. If current practice is already well calibrated, the motivation weakens, and we will report that.

Reanalysis. We rebuild the MIMIC-IV acute MI and atrial fibrillation SHR cohorts following the published definitions and covariate sets. This means checking that unconstrained fits reproduce the reported nadir near 1.02–1.04 and the Q4 vs Q1 hazard ratio of 1.32 (1.06–1.65). We then apply the test overall and within diabetes subgroups, and report where the monotone constraint binds. CIN-II is included only if data access is granted. Secondary applications are the logistic and L-shaped settings: the NHANES dietary-antioxidant and HPV association from An L-shaped link between the composite dietary antioxidant index and human papillomavirus infection and the CHARLS sleep–depression U-shape from Association between night sleep duration and depression among Chinese elderly. For these, the oracle is unchanged and only the likelihood differs.

Solver benchmarks. We time per-fit solves and full bootstrap runs against the sum-of-squares, grid and Taylor-feeding variants on these cohorts. We also replicate TP1 under a non-negativity constraint to confirm parity with the CP-spline's reported RMSE of $1.02\times10^{-4}$. All model comparisons use held-out right-censored log-likelihood, with the C-index shown only for continuity with the clinical literature.