Joinpoint Regression method for Population Dynamics Lab
This public Github repository is dedicated to a tutorial of joinpoint regression modeling in both R and in the Joinpoint Regression Program. This method is intuitive and ideal for demographic and epidemiologic analyses that requires knowing significant points of rate change in a time series. This statitsical modeling method can model any type of rate change, such as mortality, morbidity, fertility, prevalence, incidence, migration, etc. As long as it is a rate, it can model it and find where there are significant points of change.
All data, packages, and programs used in this repository are open source and free for you to use, suggest changes to, and learn from.
The data used for this tutorial can be found at:
Here is a visualization of the mortality data used in this analysis:
and we will be working our way towards fitting best-fit joinpoint models to the data:
One thing I must mention is that the above figures were made by calling a different Github repository dedicated to color palettes of Taylor Swift albums. These figures are in lover
.
I'll go through two ways to do joinpoint modeling:
- With the
ljr
(logistic joinpoint regression) package in Rljr
is powerful, but it only models logistic fits. That's okay! In the R script provided (Joinpoint Regression in R.R), I have written code to go through this step by step.
- With the Joinpoint Regression Program, which is an open-source software that you can download from the link at the top of this page.
- This program, honestly, has so much more functionality than the
ljr
package, so even though it isn't in R, I have found that it's worth demonstrating anyway. I have provided R code (Joinpoint Program Analyses.R) to walk through the data visualization provided by the model output (and I have provided the model output inmodel fits.csv
), but most of the tutorial will be accessible in a PDF where I walk through screenshots of the program.
- This program, honestly, has so much more functionality than the
All you'll need you can find here in this repository:
mortality data.csv
usa pop.csv
model fits.csv
- The ljr package (avalaible on CRAN to download)
- Other packages: ggplot2, reshape2, dplyr