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 (marginal and conditional R-squared of Nakagawa and
Schielzeth (2013) <doi:10.1111/j.2041-210x.2012.00261.x>, extended to
random slopes as in Johnson (2014) <doi:10.1111/2041-210X.12225>, 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. Any 'lme4' random-effects
structure can be supplied, and population-averaged (marginal) curves
are available for generalized linear mixed models.
| Version: |
0.3.0 |
| Depends: |
R (≥ 4.2.0) |
| Imports: |
stats, lme4, mgcv, dplyr, ggplot2, rlang, splines |
| Suggests: |
lmerTest, knitr, rmarkdown, reformulas, numDeriv, patchwork, testthat (≥ 3.0.0) |
| Published: |
2026-10-11 |
| DOI: |
10.32614/CRAN.package.MultiSpline |
| Author: |
Subir Hait [aut,
cre] |
| Maintainer: |
Subir Hait <haitsubi at msu.edu> |
| BugReports: |
https://github.com/subirhait/MultiSpline/issues |
| License: |
GPL-3 |
| URL: |
https://github.com/subirhait/MultiSpline |
| NeedsCompilation: |
no |
| Language: |
en-US |
| Materials: |
README, NEWS |
| CRAN checks: |
MultiSpline results |
Documentation:
Downloads:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=MultiSpline
to link to this page.