Package: brokenstick 2.7.0

Stef van Buuren

brokenstick: Broken Stick Model for Irregular Longitudinal Data

Data on multiple individuals through time are often sampled at times that differ between persons. Irregular observation times can severely complicate the statistical analysis of the data. The broken stick model approximates each subject’s trajectory by one or more connected line segments. The times at which segments connect (breakpoints) are identical for all subjects and under control of the user. A well-fitting broken stick model effectively transforms individual measurements made at irregular times into regular trajectories with common observation times. Specification of the model requires three variables: time, measurement and subject. The model is a special case of the linear mixed model, with time as a linear B-spline and subject as the grouping factor. The main assumptions are: subjects are exchangeable, trajectories between consecutive breakpoints are straight, random effects follow a multivariate normal distribution, and unobserved data are missing at random. The package contains functions for fitting the broken stick model to data, for predicting curves in new data and for plotting broken stick estimates. The package supports two optimization methods, and includes options to structure the variance-covariance matrix of the random effects. The analyst may use the software to smooth growth curves by a series of connected straight lines, to align irregularly observed curves to a common time grid, to create synthetic curves at a user-specified set of breakpoints, to estimate the time-to-time correlation matrix and to predict future observations. See <doi:10.18637/jss.v106.i07> for additional documentation on background, methodology and applications.

Authors:Stef van Buuren [aut, cre]

brokenstick_2.7.0.tar.gz
brokenstick_2.7.0.zip(r-4.7)brokenstick_2.7.0.zip(r-4.6)brokenstick_2.7.0.zip(r-4.5)
brokenstick_2.7.0.tgz(r-4.6-any)brokenstick_2.7.0.tgz(r-4.5-any)
brokenstick_2.7.0.tar.gz(r-4.7-any)brokenstick_2.7.0.tar.gz(r-4.6-any)
brokenstick_2.7.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
brokenstick/json (API)

# Install 'brokenstick' in R:
install.packages('brokenstick', repos = c('https://growthcharts.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/growthcharts/brokenstick/issues

Pkgdown/docs site:https://growthcharts.org

Datasets:
  • fit_200 - Broken stick model with nine lines for 200 children
  • fit_200_light - Broken stick model with nine lines for 200 children
  • smocc_200 - Infant growth of 0-2 years, SMOCC data extract
  • weightloss - Weight loss self-measurement data

On CRAN:

Conda:

b-splinegrowth-curveslinear-mixed-modelslongitudinal-data

5.43 score 9 stars 15 scripts 701 downloads 9 exports 36 dependencies

Last updated from:008044f622. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK166
source / vignettesOK257
linux-release-x86_64OK198
macos-release-arm64OK227
macos-oldrel-arm64OK151
windows-develOK170
windows-releaseOK115
windows-oldrelOK121
wasm-releaseOK127

Exports:brokenstickcontrol_krget_knotsget_omegaget_r2krplot_trajectoryrobust_chol2invset_control

Dependencies:bootclicodacpp11dplyrgenericsgluekeeplatticelifecyclelme4magrittrMASSMatrixmatrixsamplingminqanlmenloptrpillarpkgconfigpurrrR6rbibutilsRcppRcppEigenRdpackreformulasrlangstringistringrtibbletidyrtidyselectutf8vctrswithr

Overview of main functions
Objective | Plot trajectories | Fit broken stick model with one line | Fit broken stick model with two lines | Extend to nine lines | Obtain predicted values | Explained variance | Subject level analysis | Conclusion

Last update: 2026-03-13
Started: 2016-09-21

Getting started
What is the broken stick model? | What are the main model assumptions? | Why should I want to use the broken stick model? | What is in the package? | Acknowledgment

Last update: 2023-03-22
Started: 2020-10-13

Check perfect model
Objective | Data generation | Fit model | Conclusions

Last update: 2022-10-27
Started: 2016-02-26

Help for old friends
Background | Main changes | Minor changes | Install legacy version | Examples | Example 1: Fit model | Example 2: Predict model | Example 3: Plot model

Last update: 2022-10-27
Started: 2020-06-15