MultiSpline: Spline-Based Nonlinear Modeling for Multilevel and Longitudinal Data

Provides a unified framework for fitting, predicting, and interpreting nonlinear relationships in single-level, multilevel, and longitudinal regression models. Flexible functional forms are supported using natural cubic splines ('splines'), B-splines ('splines'), and GAM smooths ('mgcv'). Supports two-way and nested clustering via 'lme4', automatic knot selection by AIC or BIC, multilevel R-squared decomposition (Nakagawa-Schielzeth marginal and conditional R-squared with level-specific variance partitioning), a postestimation suite returning first and second derivatives with confidence bands, turning points and inflection regions, and a model comparison workflow contrasting linear, polynomial, and spline fits by AIC, BIC, and likelihood-ratio tests. Cluster heterogeneity in nonlinear effects is supported via random-slope spline terms.

Getting started

Package details

AuthorSubir Hait [aut, cre] (ORCID: <https://orcid.org/0009-0004-9871-9677>)
MaintainerSubir Hait <haitsubi@msu.edu>
LicenseGPL-3
Version0.2.0
URL https://github.com/causalfragility-lab/MultiSpline
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("MultiSpline")

Try the MultiSpline package in your browser

Any scripts or data that you put into this service are public.

MultiSpline documentation built on April 16, 2026, 9:06 a.m.