├── .gitignore ├── Rplot.jpeg ├── Rplot.tiff ├── Figures ├── plot_pi.png ├── plot_tb.png ├── all causes.png ├── log_plot_pi.png ├── log_plot_tb.png ├── plot_cancer.png ├── plot_heart.png ├── plot_stroke.png ├── log_plot_heart.png ├── plot_accidents.png ├── log_plot_cancer.png ├── log_plot_stroke.png ├── best-fit all causes.png └── log_plot_accidents.png ├── Tutorial of the Joinpoint Regression Program.pdf ├── joinpoint-regression-tutorial.Rproj ├── usa pop.csv ├── README.md ├── Joinpoint Program Analyses.R ├── mortality data.csv ├── Joinpoint Regression in R.R └── model fits.csv /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /Rplot.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Rplot.jpeg -------------------------------------------------------------------------------- /Rplot.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Rplot.tiff -------------------------------------------------------------------------------- /Figures/plot_pi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/plot_pi.png -------------------------------------------------------------------------------- /Figures/plot_tb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/plot_tb.png -------------------------------------------------------------------------------- /Figures/all causes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/all causes.png -------------------------------------------------------------------------------- /Figures/log_plot_pi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/log_plot_pi.png -------------------------------------------------------------------------------- /Figures/log_plot_tb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/log_plot_tb.png -------------------------------------------------------------------------------- /Figures/plot_cancer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/plot_cancer.png -------------------------------------------------------------------------------- /Figures/plot_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/plot_heart.png -------------------------------------------------------------------------------- /Figures/plot_stroke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/plot_stroke.png -------------------------------------------------------------------------------- /Figures/log_plot_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/log_plot_heart.png -------------------------------------------------------------------------------- /Figures/plot_accidents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/plot_accidents.png -------------------------------------------------------------------------------- /Figures/log_plot_cancer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/log_plot_cancer.png -------------------------------------------------------------------------------- /Figures/log_plot_stroke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/log_plot_stroke.png -------------------------------------------------------------------------------- /Figures/best-fit all causes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/best-fit all causes.png -------------------------------------------------------------------------------- /Figures/log_plot_accidents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Figures/log_plot_accidents.png -------------------------------------------------------------------------------- /Tutorial of the Joinpoint Regression Program.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taylorvandoren/joinpoint-regression-tutorial/HEAD/Tutorial of the Joinpoint Regression Program.pdf -------------------------------------------------------------------------------- /joinpoint-regression-tutorial.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /usa pop.csv: -------------------------------------------------------------------------------- 1 | year,pop 2 | 1998,275800000 3 | 1997,272650000 4 | 1996,269390000 5 | 1995,266280000 6 | 1994,263130000 7 | 1993,259920000 8 | 1992,256510000 9 | 1991,252980000 10 | 1990,249620000 11 | 1989,246820000 12 | 1988,244500000 13 | 1987,242290000 14 | 1986,240130000 15 | 1985,237920000 16 | 1984,235820000 17 | 1983,233790000 18 | 1982,231660000 19 | 1981,229470000 20 | 1980,227220000 21 | 1979,225060000 22 | 1978,222580000 23 | 1977,220240000 24 | 1976,218040000 25 | 1975,215970000 26 | 1974,213850000 27 | 1973,211910000 28 | 1972,209900000 29 | 1971,207660000 30 | 1970,205050000 31 | 1969,202680000 32 | 1968,200710000 33 | 1967,198710000 34 | 1966,196560000 35 | 1965,194300000 36 | 1964,191890000 37 | 1963,189240000 38 | 1962,186540000 39 | 1961,183690000 40 | 1960,180670000 41 | 1959,177830000 42 | 1958,174880000 43 | 1957,171980000 44 | 1956,168900000 45 | 1955,165930000 46 | 1954,163030000 47 | 1953,160180000 48 | 1952,157550000 49 | 1951,154880000 50 | 1950,152270000 51 | 1949,149190000 52 | 1948,146630000 53 | 1947,144130000 54 | 1946,141390000 55 | 1945,139930000 56 | 1944,138400000 57 | 1943,136740000 58 | 1942,134860000 59 | 1941,133400000 60 | 1940,132120000 61 | 1939,130880000 62 | 1938,129820000 63 | 1937,128820000 64 | 1936,128050000 65 | 1935,127250000 66 | 1934,126370000 67 | 1933,125580000 68 | 1932,124840000 69 | 1931,124040000 70 | 1930,123080000 71 | 1929,121770000 72 | 1928,120510000 73 | 1927,119040000 74 | 1926,117400000 75 | 1925,115830000 76 | 1924,114110000 77 | 1923,111950000 78 | 1922,110050000 79 | 1921,108540000 80 | 1920,106460000 81 | 1919,104510000 82 | 1918,103210000 83 | 1917,103270000 84 | 1916,101960000 85 | 1915,100550000 86 | 1914,99110000 87 | 1913,97220000 88 | 1912,95330000 89 | 1911,93860000 90 | 1910,92410000 91 | 1909,90490000 92 | 1908,88710000 93 | 1907,87010000 94 | 1906,85450000 95 | 1905,83820000 96 | 1904,82170000 97 | 1903,80630000 98 | 1902,79160000 99 | 1901,77580000 100 | 1900,76090000 101 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # joinpoint-regression-tutorial 2 | Joinpoint Regression method for Population Dynamics Lab 3 | 4 | ## Welcome! 5 | 6 | This public Github repository is dedicated to a tutorial of **joinpoint regression modeling** in both R and in the [Joinpoint Regression Program](https://surveillance.cancer.gov/joinpoint/). 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. 7 | 8 | *All data, packages, and programs used in this repository are open source and free for you to use, suggest changes to, and learn from.* 9 | 10 | The data used for this tutorial can be found at: 11 | ### [United States Vital Statistics, Age-Adjusted Death Rates for Leading Causes of Death, 1900-1998](https://www.cdc.gov/nchs/nvss/mortality/hist293.htm) 12 | 13 | Here is a visualization of the mortality data used in this analysis: 14 | ![causes of death (accidents, cancer, heart disease, influenza & pneumonia, stroke, and tuberculosis) in the United States from 1900-1998](https://github.com/taylorvandoren/joinpoint-regression-tutorial/blob/f4b4fd8feba8acd553449e92bc6076174ad1c2e2/Rplot.jpeg) 15 | 16 | and we will be working our way towards fitting best-fit joinpoint models to the data: 17 | ![causes of death in the United States from 1900-1998 with best-fit joinpoint models visualized with data](https://taylorvandoren.files.wordpress.com/2021/10/best-fit-all-causes.png) 18 | 19 | *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](https://github.com/asteves/tayloRswift). These figures are in `lover`.* 20 | 21 | ## Analyses we'll do 22 | 23 | I'll go through two ways to do joinpoint modeling: 24 | 1. With the `ljr` (logistic joinpoint regression) package in R 25 | - `ljr` 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. 26 | 3. With the **Joinpoint Regression Program**, which is an open-source software that you can download from the link at the top of this page. 27 | - 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 in `model fits.csv`), but *most* of the tutorial will be accessible in a PDF where I walk through screenshots of the program. 28 | 29 | 30 | ## What you'll need 31 | 32 | All you'll need you can find here in this repository: 33 | - `mortality data.csv` 34 | - `usa pop.csv` 35 | - `model fits.csv` 36 | - The ljr package (avalaible on CRAN to download) 37 | - Other packages: ggplot2, reshape2, dplyr 38 | -------------------------------------------------------------------------------- /Joinpoint Program Analyses.R: -------------------------------------------------------------------------------- 1 | ### JOINPOINT REGRESSION TUTORIAL 2 | ### Guidelines for analyses in the Joinpoint Regression Program, built by the National Institutes of Health 3 | 4 | # Taylor P. van Doren, ABD 5 | # October 18, 2021 6 | 7 | ### IMPORTANT PRELUDE 8 | 9 | # This file will go through the process of joinpoint regression analysis using the Joinpoint Regression Program 10 | # Joinpoint Trend Analysis is a statistical software built by the National Cancer Institute of the 11 | # National Institutes of health, Division of Cancer Control& Population Science. The program is completely 12 | # open source and available for download at surveillance.cancer.gov/joinpoint. All you have to do is register 13 | # for the software, and you will be sent a link with permission to download the program. It is perfect for 14 | # researchers seeking to gain some insights into how rates change over time. 15 | # This file will introdue the data and get it ready to import into the joinpoint program, but the bulk of the 16 | # analysis will not be performed within this R file. Most of the code here will be devoted to creating 17 | # visualizations of the data and analyses performed outside the file in the Joinpoint Regression Program. 18 | 19 | # There is another file dedicated to logistic joinpoint analyses within this Github Repository. Each of these 20 | # methods are useful, but they are different approaches, so use the one that serves you best. 21 | 22 | 23 | ### LOAD LIBRARIES 24 | 25 | library(ggplot2) 26 | library(ggsci) 27 | 28 | 29 | ### LOAD DATA 30 | 31 | # This data is from the CDC National Center for Health Statistics National Vital Statistics System, 32 | # the Age-Adjusted Death Rates for Selected Causes, Death Registration States, 1900-1932, and 33 | # United States 1933-98. 34 | # link: https://www.cdc.gov/nchs/nvss/mortality/hist293.htm 35 | 36 | mortdata <- read.csv("mortality data.csv") 37 | 38 | 39 | ### PLOT THE DATA 40 | 41 | ggplot(mortdata, aes(year, asdr, color = cod)) + 42 | geom_point(size = 3.5, shape = 1) + 43 | geom_smooth() + 44 | theme_classic() + 45 | xlab("Year") + 46 | ylab("Age-Adjusted Death Rate (per 100,000)") + 47 | scale_color_jco() 48 | 49 | # Looking at the initial plot will really help us develop some intuition about the kinds of results we 50 | # might hope to see from the regression analyses. Since this regression method identifies points of 51 | # significant change in rates over a time period, and there are some clear points here that we will 52 | # be looking out for when we run the regression. 53 | 54 | # For example, it's clear that there was a major increase and then decrease of mortality rates from heart 55 | # disease during the 20th century, and it appears as if the turning point was somewhere during the 56 | # 1950s. We should keep our eyes out for identified joinpoints in that decade. 57 | 58 | # The data are in the correct format for analyses in the joinpoint program, so we'll head over there to 59 | # get the data analyzed. 60 | 61 | ### SEE THE PDF OF THE INSTRUCTIONS ON HOW TO RUN THESE ANALYSES IN THE JOINPOINT REGRESSION SOFTWARE. 62 | 63 | # After analyses, we'll need to put together all the results and import them back to R so we can create 64 | # some more appealing figures. 65 | 66 | # Import all model fits 67 | 68 | modelfits <- read.csv("model fits.csv") 69 | 70 | # modelfits has many columns of data, but they are all arranged to follow the basic format: 71 | # year 72 | # cause of death observed mortality rate (per 100,000) <-- original data used to fit models 73 | # cod.0: model fit with zero joinpoints 74 | # cod.1: model fit with one joinpoint 75 | # cod.2: model fit with two joinpoints 76 | # cod.3: model fit with three joinpoints 77 | 78 | # Below, we will plot each cause of death separately so we can easily see all the model fits. 79 | # The best-fit model as determined by the software will appear as a solid line; 80 | # all other model fits appear as dashed lines. 81 | 82 | # ACCIDENTS 83 | ggplot(modelfits, aes(x = year, y = accidents.obs)) + 84 | geom_point(size = 3.5, shape = 21, col = "black", fill = "darkgrey") + 85 | geom_line(aes(year, accidents.0), col = "#c91e63", size = 1.1, linetype = "dashed") + 86 | geom_line(aes(year, accidents.1), col = "#9c27b0", size = 1.1, linetype = "dashed") + 87 | geom_line(aes(year, accidents.2), col = "#ee5722", size = 1.1, linetype = "dashed") + 88 | geom_line(aes(year, accidents.3), col = "#00bcd4", size = 1.5) + 89 | theme_classic() + 90 | xlab("Year") + 91 | ylab("Age-Adjusted Death Rate (per 100,000)") + 92 | ggtitle("Accidents") 93 | 94 | # CANCER 95 | ggplot(modelfits, aes(x = year, y = cancer.obs)) + 96 | geom_point(size = 3.5, shape = 21, col = "black", fill = "darkgrey") + 97 | geom_line(aes(year, cancer.0), col = "#c91e63", size = 1.1, linetype = "dashed") + 98 | geom_line(aes(year, cancer.1), col = "#9c27b0", size = 1.1, linetype = "dashed") + 99 | geom_line(aes(year, cancer.2), col = "#ee5722", size = 1.1, linetype = "dashed") + 100 | geom_line(aes(year, cancer.3), col = "#00bcd4", size = 1.5) + 101 | theme_classic() + 102 | xlab("Year") + 103 | ylab("Age-Adjusted Death Rate (per 100,000)") + 104 | ggtitle("Cancer") 105 | 106 | # HEART DISEASE 107 | ggplot(modelfits, aes(x = year, y = heart.obs)) + 108 | geom_point(size = 3.5, shape = 21, col = "black", fill = "darkgrey") + 109 | geom_line(aes(year, heart.0), col = "#c91e63", size = 1.1, linetype = "dashed") + 110 | geom_line(aes(year, heart.1), col = "#9c27b0", size = 1.1, linetype = "dashed") + 111 | geom_line(aes(year, heart.2), col = "#ee5722", size = 1.1, linetype = "dashed") + 112 | geom_line(aes(year, heart.3), col = "#00bcd4", size = 1.5) + 113 | theme_classic() + 114 | xlab("Year") + 115 | ylab("Age-Adjusted Death Rate (per 100,000)") + 116 | ggtitle("Heart Disease") 117 | 118 | # PNEUMONIA & INFLUENZA 119 | ggplot(modelfits, aes(x = year, y = pi.obs)) + 120 | geom_point(size = 3.5, shape = 21, col = "black", fill = "darkgrey") + 121 | geom_line(aes(year, pi.0), col = "#c91e63", size = 1.1, linetype = "dashed") + 122 | geom_line(aes(year, pi.1), col = "#9c27b0", size = 1.5) + 123 | geom_line(aes(year, pi.2), col = "#ee5722", size = 1.1, linetype = "dashed") + 124 | geom_line(aes(year, pi.3), col = "#00bcd4", size = 1.1, linetype = "dashed") + 125 | geom_hline(yintercept = 0, linetype = "dashed") + 126 | theme_classic() + 127 | xlab("Year") + 128 | ylab("Age-Adjusted Death Rate (per 100,000)") + 129 | ggtitle("Influenza & Pneumonia (P&I)") 130 | 131 | # STROKE 132 | ggplot(modelfits, aes(x = year, y = stroke.obs)) + 133 | geom_point(size = 3.5, shape = 21, col = "black", fill = "darkgrey") + 134 | geom_line(aes(year, stroke.0), col = "#c91e63", size = 1.1, linetype = "dashed") + 135 | geom_line(aes(year, stroke.1), col = "#9c27b0", size = 1.1, linetype = "dashed") + 136 | geom_line(aes(year, stroke.2), col = "#ee5722", size = 1.1, linetype = "dashed") + 137 | geom_line(aes(year, stroke.3), col = "#00bcd4", size = 1.5) + 138 | theme_classic() + 139 | xlab("Year") + 140 | ylab("Age-Adjusted Death Rate (per 100,000)") + 141 | ggtitle("Stroke") 142 | 143 | # TUBERCULOSIS 144 | ggplot(modelfits, aes(x = year, y = tb.obs)) + 145 | geom_point(size = 3.5, shape = 21, col = "black", fill = "darkgrey") + 146 | geom_line(aes(year, tb.0), col = "#c91e63", size = 1.1, linetype = "dashed") + 147 | geom_line(aes(year, tb.1), col = "#9c27b0", size = 1.1, linetype = "dashed") + 148 | geom_line(aes(year, tb.2), col = "#ee5722", size = 1.1, linetype = "dashed") + 149 | geom_line(aes(year, tb.3), col = "#00bcd4", size = 1.5) + 150 | geom_hline(yintercept = 0, linetype = "dashed") + 151 | theme_classic() + 152 | xlab("Year") + 153 | ylab("Age-Adjusted Death Rate (per 100,000)") + 154 | ggtitle("Tuberculosis (TB)") 155 | 156 | # Let's make a conglomerate plot to put all the best-fit models together with the fitted data 157 | ggplot(modelfits) + 158 | geom_point(aes(year, accidents.obs), size = 3, shape = 21, color = "#5d6d7e", fill = "grey") + 159 | geom_point(aes(year, cancer.obs), size = 3, shape = 21, color = "#5d6d7e", fill = "grey") + 160 | geom_point(aes(year, heart.obs), size = 3, shape = 21, color = "#5d6d7e", fill = "grey") + 161 | geom_point(aes(year, pi.obs), size = 3, shape = 21, color = "#5d6d7e", fill = "grey") + 162 | geom_point(aes(year, stroke.obs), size = 3, shape = 21, color = "#5d6d7e", fill = "grey") + 163 | geom_point(aes(year, tb.obs), size = 3, shape = 21, color = "#5d6d7e", fill = "grey") + 164 | geom_line(aes(year, accidents.3), col = "#b8396b", size = 1.5) + 165 | geom_line(aes(year, cancer.3), col = "#ffd1d7", size = 1.5) + 166 | geom_line(aes(year, heart.3), col = "#fff5cc", size = 1.5) + 167 | geom_line(aes(year, pi.1), col = "#76bae0", size = 1.5) + 168 | geom_line(aes(year, stroke.3), col = "#b28f81", size = 1.5) + 169 | geom_line(aes(year, tb.3), col = "#54483e", size = 1.5) + 170 | theme_classic() + 171 | xlab("Year") + 172 | ylab("Age-Adjusted Moratlity Rate (per 100,000)") + 173 | ggtitle("Major Causes of Death (1900-1998) with Best-Fits") 174 | -------------------------------------------------------------------------------- /mortality data.csv: -------------------------------------------------------------------------------- 1 | year,cod,asdr 2 | 1900,Accidents,90.3 3 | 1901,Accidents,109.3 4 | 1902,Accidents,93.6 5 | 1903,Accidents,106.9 6 | 1904,Accidents,112.8 7 | 1905,Accidents,108.5 8 | 1906,Accidents,121.2 9 | 1907,Accidents,122.3 10 | 1908,Accidents,108.8 11 | 1909,Accidents,108 12 | 1910,Accidents,111.2 13 | 1911,Accidents,113.5 14 | 1912,Accidents,107.1 15 | 1913,Accidents,108.2 16 | 1914,Accidents,100.4 17 | 1915,Accidents,95.2 18 | 1916,Accidents,104.3 19 | 1917,Accidents,107 20 | 1918,Accidents,99.9 21 | 1919,Accidents,86.9 22 | 1920,Accidents,87.5 23 | 1921,Accidents,83.2 24 | 1922,Accidents,85.4 25 | 1923,Accidents,91.2 26 | 1924,Accidents,89.6 27 | 1925,Accidents,92.2 28 | 1926,Accidents,89.8 29 | 1927,Accidents,86.3 30 | 1928,Accidents,86.1 31 | 1929,Accidents,84.3 32 | 1930,Accidents,84.2 33 | 1931,Accidents,81.2 34 | 1932,Accidents,76.6 35 | 1933,Accidents,76.2 36 | 1934,Accidents,82.7 37 | 1935,Accidents,80.8 38 | 1936,Accidents,92.4 39 | 1937,Accidents,81.8 40 | 1938,Accidents,76.5 41 | 1939,Accidents,74.7 42 | 1940,Accidents,76 43 | 1941,Accidents,72.7 44 | 1942,Accidents,75.6 45 | 1943,Accidents,82.1 46 | 1944,Accidents,77 47 | 1945,Accidents,74.9 48 | 1946,Accidents,69.4 49 | 1947,Accidents,69.9 50 | 1948,Accidents,68.6 51 | 1949,Accidents,57.6 52 | 1950,Accidents,78.4 53 | 1951,Accidents,79.7 54 | 1952,Accidents,78 55 | 1953,Accidents,75.4 56 | 1954,Accidents,69.9 57 | 1955,Accidents,70.9 58 | 1956,Accidents,70.2 59 | 1957,Accidents,69.1 60 | 1958,Accidents,63.6 61 | 1959,Accidents,63.2 62 | 1960,Accidents,63.1 63 | 1961,Accidents,60.6 64 | 1962,Accidents,62.9 65 | 1963,Accidents,64 66 | 1964,Accidents,64.1 67 | 1965,Accidents,65.8 68 | 1966,Accidents,67.6 69 | 1967,Accidents,66.2 70 | 1968,Accidents,65.5 71 | 1969,Accidents,64.9 72 | 1970,Accidents,62.2 73 | 1971,Accidents,60.3 74 | 1972,Accidents,60.2 75 | 1973,Accidents,59.3 76 | 1974,Accidents,52.7 77 | 1975,Accidents,50.8 78 | 1976,Accidents,48.7 79 | 1977,Accidents,48.8 80 | 1978,Accidents,48.9 81 | 1979,Accidents,46.5 82 | 1980,Accidents,46.4 83 | 1981,Accidents,43.4 84 | 1982,Accidents,40.1 85 | 1983,Accidents,39.1 86 | 1984,Accidents,38.8 87 | 1985,Accidents,38.5 88 | 1986,Accidents,38.6 89 | 1987,Accidents,38.2 90 | 1988,Accidents,38.9 91 | 1989,Accidents,37.7 92 | 1990,Accidents,36.2 93 | 1991,Accidents,34.7 94 | 1992,Accidents,33.2 95 | 1993,Accidents,34.2 96 | 1994,Accidents,34.2 97 | 1995,Accidents,34.4 98 | 1996,Accidents,34.5 99 | 1997,Accidents,34.2 100 | 1998,Accidents,34.5 101 | 1900,Cancer,114.8 102 | 1901,Cancer,118.1 103 | 1902,Cancer,119.7 104 | 1903,Cancer,125.2 105 | 1904,Cancer,127.9 106 | 1905,Cancer,132.5 107 | 1906,Cancer,128.8 108 | 1907,Cancer,133 109 | 1908,Cancer,134.5 110 | 1909,Cancer,138.1 111 | 1910,Cancer,143.1 112 | 1911,Cancer,140.4 113 | 1912,Cancer,144.7 114 | 1913,Cancer,147.8 115 | 1914,Cancer,146.6 116 | 1915,Cancer,149.5 117 | 1916,Cancer,152.2 118 | 1917,Cancer,150.7 119 | 1918,Cancer,148.4 120 | 1919,Cancer,152.1 121 | 1920,Cancer,159 122 | 1921,Cancer,163.5 123 | 1922,Cancer,165.6 124 | 1923,Cancer,168.8 125 | 1924,Cancer,170.6 126 | 1925,Cancer,174.3 127 | 1926,Cancer,177.3 128 | 1927,Cancer,177.8 129 | 1928,Cancer,177.8 130 | 1929,Cancer,175.3 131 | 1930,Cancer,174.5 132 | 1931,Cancer,175.8 133 | 1932,Cancer,179.2 134 | 1933,Cancer,178.2 135 | 1934,Cancer,181.6 136 | 1935,Cancer,183.4 137 | 1936,Cancer,186.8 138 | 1937,Cancer,184.6 139 | 1938,Cancer,185.7 140 | 1939,Cancer,187.1 141 | 1940,Cancer,187.8 142 | 1941,Cancer,184.1 143 | 1942,Cancer,183.8 144 | 1943,Cancer,183.9 145 | 1944,Cancer,183.8 146 | 1945,Cancer,186.9 147 | 1946,Cancer,187.1 148 | 1947,Cancer,190.7 149 | 1948,Cancer,193.4 150 | 1949,Cancer,193.9 151 | 1950,Cancer,193.9 152 | 1951,Cancer,192 153 | 1952,Cancer,194.2 154 | 1953,Cancer,194.6 155 | 1954,Cancer,194.3 156 | 1955,Cancer,194.5 157 | 1956,Cancer,195.6 158 | 1957,Cancer,195.4 159 | 1958,Cancer,192 160 | 1959,Cancer,191.6 161 | 1960,Cancer,193.9 162 | 1961,Cancer,193.4 163 | 1962,Cancer,193.3 164 | 1963,Cancer,194.7 165 | 1964,Cancer,193.6 166 | 1965,Cancer,195.6 167 | 1966,Cancer,196.5 168 | 1967,Cancer,197.3 169 | 1968,Cancer,198.8 170 | 1969,Cancer,198.5 171 | 1970,Cancer,198.6 172 | 1971,Cancer,199.3 173 | 1972,Cancer,200.3 174 | 1973,Cancer,200 175 | 1974,Cancer,201.5 176 | 1975,Cancer,200.1 177 | 1976,Cancer,202.5 178 | 1977,Cancer,203.5 179 | 1978,Cancer,204.9 180 | 1979,Cancer,204 181 | 1980,Cancer,207.9 182 | 1981,Cancer,206.4 183 | 1982,Cancer,208.3 184 | 1983,Cancer,209.1 185 | 1984,Cancer,210.8 186 | 1985,Cancer,211.3 187 | 1986,Cancer,211.5 188 | 1987,Cancer,211.7 189 | 1988,Cancer,212.5 190 | 1989,Cancer,214.2 191 | 1990,Cancer,216 192 | 1991,Cancer,215.2 193 | 1992,Cancer,213.5 194 | 1993,Cancer,213.5 195 | 1994,Cancer,211.7 196 | 1995,Cancer,209.8 197 | 1996,Cancer,206.7 198 | 1997,Cancer,203.5 199 | 1998,Cancer,200.7 200 | 1900,Heart Disease,265.4 201 | 1901,Heart Disease,272.6 202 | 1902,Heart Disease,285.2 203 | 1903,Heart Disease,304.5 204 | 1904,Heart Disease,331.5 205 | 1905,Heart Disease,327.8 206 | 1906,Heart Disease,325.5 207 | 1907,Heart Disease,356.5 208 | 1908,Heart Disease,328.6 209 | 1909,Heart Disease,329.2 210 | 1910,Heart Disease,345.1 211 | 1911,Heart Disease,341.8 212 | 1912,Heart Disease,346 213 | 1913,Heart Disease,337.9 214 | 1914,Heart Disease,346.4 215 | 1915,Heart Disease,361.5 216 | 1916,Heart Disease,373.3 217 | 1917,Heart Disease,377.9 218 | 1918,Heart Disease,366.2 219 | 1919,Heart Disease,335.7 220 | 1920,Heart Disease,375 221 | 1921,Heart Disease,366.2 222 | 1922,Heart Disease,392.1 223 | 1923,Heart Disease,410.3 224 | 1924,Heart Disease,410.5 225 | 1925,Heart Disease,433.8 226 | 1926,Heart Disease,465.7 227 | 1927,Heart Disease,448.8 228 | 1928,Heart Disease,478.9 229 | 1929,Heart Disease,476.2 230 | 1930,Heart Disease,467.9 231 | 1931,Heart Disease,459.6 232 | 1932,Heart Disease,482.8 233 | 1933,Heart Disease,483.8 234 | 1934,Heart Disease,502.9 235 | 1935,Heart Disease,506.8 236 | 1936,Heart Disease,546.2 237 | 1937,Heart Disease,538.8 238 | 1938,Heart Disease,528.9 239 | 1939,Heart Disease,534.5 240 | 1940,Heart Disease,558.5 241 | 1941,Heart Disease,537.9 242 | 1942,Heart Disease,531.7 243 | 1943,Heart Disease,567.5 244 | 1944,Heart Disease,541.1 245 | 1945,Heart Disease,533.2 246 | 1946,Heart Disease,527.7 247 | 1947,Heart Disease,552.5 248 | 1948,Heart Disease,549 249 | 1949,Heart Disease,581 250 | 1950,Heart Disease,588.8 251 | 1951,Heart Disease,577.9 252 | 1952,Heart Disease,568.8 253 | 1953,Heart Disease,570.1 254 | 1954,Heart Disease,544.6 255 | 1955,Heart Disease,556.7 256 | 1956,Heart Disease,560.6 257 | 1957,Heart Disease,568.5 258 | 1958,Heart Disease,563.6 259 | 1959,Heart Disease,552.1 260 | 1960,Heart Disease,559 261 | 1961,Heart Disease,545.3 262 | 1962,Heart Disease,556.9 263 | 1963,Heart Disease,563.4 264 | 1964,Heart Disease,543.3 265 | 1965,Heart Disease,542.5 266 | 1966,Heart Disease,541.2 267 | 1967,Heart Disease,524.7 268 | 1968,Heart Disease,531 269 | 1969,Heart Disease,516.8 270 | 1970,Heart Disease,492.7 271 | 1971,Heart Disease,492.9 272 | 1972,Heart Disease,490.2 273 | 1973,Heart Disease,482 274 | 1974,Heart Disease,458.8 275 | 1975,Heart Disease,431.2 276 | 1976,Heart Disease,426.9 277 | 1977,Heart Disease,413.7 278 | 1978,Heart Disease,409.9 279 | 1979,Heart Disease,401.6 280 | 1980,Heart Disease,412.1 281 | 1981,Heart Disease,397 282 | 1982,Heart Disease,389 283 | 1983,Heart Disease,388.9 284 | 1984,Heart Disease,378.8 285 | 1985,Heart Disease,375 286 | 1986,Heart Disease,365.1 287 | 1987,Heart Disease,355.9 288 | 1988,Heart Disease,352.5 289 | 1989,Heart Disease,332 290 | 1990,Heart Disease,321.8 291 | 1991,Heart Disease,313.8 292 | 1992,Heart Disease,306.1 293 | 1993,Heart Disease,309.9 294 | 1994,Heart Disease,299.7 295 | 1995,Heart Disease,296.3 296 | 1996,Heart Disease,288.3 297 | 1997,Heart Disease,280.4 298 | 1998,Heart Disease,272.4 299 | 1900,Influenza and Pneumonia,297.5 300 | 1901,Influenza and Pneumonia,312.9 301 | 1902,Influenza and Pneumonia,219.3 302 | 1903,Influenza and Pneumonia,251.1 303 | 1904,Influenza and Pneumonia,291.2 304 | 1905,Influenza and Pneumonia,257.8 305 | 1906,Influenza and Pneumonia,222.5 306 | 1907,Influenza and Pneumonia,285.4 307 | 1908,Influenza and Pneumonia,234.6 308 | 1909,Influenza and Pneumonia,221.2 309 | 1910,Influenza and Pneumonia,238.4 310 | 1911,Influenza and Pneumonia,234.1 311 | 1912,Influenza and Pneumonia,213.7 312 | 1913,Influenza and Pneumonia,214.8 313 | 1914,Influenza and Pneumonia,202.4 314 | 1915,Influenza and Pneumonia,238.1 315 | 1916,Influenza and Pneumonia,278.5 316 | 1917,Influenza and Pneumonia,267 317 | 1918,Influenza and Pneumonia,612.4 318 | 1919,Influenza and Pneumonia,270.9 319 | 1920,Influenza and Pneumonia,279.2 320 | 1921,Influenza and Pneumonia,153.1 321 | 1922,Influenza and Pneumonia,207.6 322 | 1923,Influenza and Pneumonia,253 323 | 1924,Influenza and Pneumonia,182 324 | 1925,Influenza and Pneumonia,198.1 325 | 1926,Influenza and Pneumonia,233 326 | 1927,Influenza and Pneumonia,164 327 | 1928,Influenza and Pneumonia,236.4 328 | 1929,Influenza and Pneumonia,247.5 329 | 1930,Influenza and Pneumonia,159.8 330 | 1931,Influenza and Pneumonia,170.2 331 | 1932,Influenza and Pneumonia,180 332 | 1933,Influenza and Pneumonia,156.5 333 | 1934,Influenza and Pneumonia,152.9 334 | 1935,Influenza and Pneumonia,163.8 335 | 1936,Influenza and Pneumonia,186.7 336 | 1937,Influenza and Pneumonia,181.8 337 | 1938,Influenza and Pneumonia,124.3 338 | 1939,Influenza and Pneumonia,124.4 339 | 1940,Influenza and Pneumonia,117.6 340 | 1941,Influenza and Pneumonia,104.6 341 | 1942,Influenza and Pneumonia,84.7 342 | 1943,Influenza and Pneumonia,101.7 343 | 1944,Influenza and Pneumonia,94.7 344 | 1945,Influenza and Pneumonia,74.9 345 | 1946,Influenza and Pneumonia,69.9 346 | 1947,Influenza and Pneumonia,65.9 347 | 1948,Influenza and Pneumonia,58 348 | 1949,Influenza and Pneumonia,45.1 349 | 1950,Influenza and Pneumonia,48.1 350 | 1951,Influenza and Pneumonia,47.4 351 | 1952,Influenza and Pneumonia,43.1 352 | 1953,Influenza and Pneumonia,49.2 353 | 1954,Influenza and Pneumonia,36.2 354 | 1955,Influenza and Pneumonia,39.2 355 | 1956,Influenza and Pneumonia,40.8 356 | 1957,Influenza and Pneumonia,50.3 357 | 1958,Influenza and Pneumonia,47.4 358 | 1959,Influenza and Pneumonia,44.3 359 | 1960,Influenza and Pneumonia,53.7 360 | 1961,Influenza and Pneumonia,43.4 361 | 1962,Influenza and Pneumonia,47.1 362 | 1963,Influenza and Pneumonia,55.6 363 | 1964,Influenza and Pneumonia,45.4 364 | 1965,Influenza and Pneumonia,46.8 365 | 1966,Influenza and Pneumonia,47.9 366 | 1967,Influenza and Pneumonia,42.2 367 | 1968,Influenza and Pneumonia,52.8 368 | 1969,Influenza and Pneumonia,47.9 369 | 1970,Influenza and Pneumonia,41.7 370 | 1971,Influenza and Pneumonia,38.4 371 | 1972,Influenza and Pneumonia,41.3 372 | 1973,Influenza and Pneumonia,41.2 373 | 1974,Influenza and Pneumonia,35.5 374 | 1975,Influenza and Pneumonia,34.9 375 | 1976,Influenza and Pneumonia,38.8 376 | 1977,Influenza and Pneumonia,31 377 | 1978,Influenza and Pneumonia,34.5 378 | 1979,Influenza and Pneumonia,26.1 379 | 1980,Influenza and Pneumonia,31.4 380 | 1981,Influenza and Pneumonia,30 381 | 1982,Influenza and Pneumonia,26.5 382 | 1983,Influenza and Pneumonia,29.8 383 | 1984,Influenza and Pneumonia,30.6 384 | 1985,Influenza and Pneumonia,34.5 385 | 1986,Influenza and Pneumonia,34.8 386 | 1987,Influenza and Pneumonia,33.8 387 | 1988,Influenza and Pneumonia,37.3 388 | 1989,Influenza and Pneumonia,35.9 389 | 1990,Influenza and Pneumonia,36.8 390 | 1991,Influenza and Pneumonia,34.9 391 | 1992,Influenza and Pneumonia,33.1 392 | 1993,Influenza and Pneumonia,35.2 393 | 1994,Influenza and Pneumonia,33.9 394 | 1995,Influenza and Pneumonia,33.8 395 | 1996,Influenza and Pneumonia,33.2 396 | 1997,Influenza and Pneumonia,33.6 397 | 1998,Influenza and Pneumonia,34.6 398 | 1900,Stroke,244.2 399 | 1901,Stroke,243.6 400 | 1902,Stroke,237.8 401 | 1903,Stroke,244.6 402 | 1904,Stroke,255.2 403 | 1905,Stroke,247.3 404 | 1906,Stroke,245.9 405 | 1907,Stroke,261.8 406 | 1908,Stroke,239 407 | 1909,Stroke,237.5 408 | 1910,Stroke,238.5 409 | 1911,Stroke,230.2 410 | 1912,Stroke,228.7 411 | 1913,Stroke,226.9 412 | 1914,Stroke,231.3 413 | 1915,Stroke,234.5 414 | 1916,Stroke,235.7 415 | 1917,Stroke,238.2 416 | 1918,Stroke,228 417 | 1919,Stroke,225.6 418 | 1920,Stroke,238.5 419 | 1921,Stroke,230.1 420 | 1922,Stroke,238.9 421 | 1923,Stroke,245.6 422 | 1924,Stroke,246.4 423 | 1925,Stroke,227.9 424 | 1926,Stroke,228.2 425 | 1927,Stroke,216.3 426 | 1928,Stroke,223.4 427 | 1929,Stroke,213.3 428 | 1930,Stroke,203.9 429 | 1931,Stroke,195 430 | 1932,Stroke,194.4 431 | 1933,Stroke,185 432 | 1934,Stroke,184.5 433 | 1935,Stroke,181.2 434 | 1936,Stroke,189.8 435 | 1937,Stroke,176.6 436 | 1938,Stroke,171.4 437 | 1939,Stroke,173.2 438 | 1940,Stroke,177.2 439 | 1941,Stroke,169.4 440 | 1942,Stroke,166.8 441 | 1943,Stroke,173.3 442 | 1944,Stroke,164.4 443 | 1945,Stroke,166.7 444 | 1946,Stroke,158.8 445 | 1947,Stroke,161.3 446 | 1948,Stroke,157.4 447 | 1949,Stroke,176.2 448 | 1950,Stroke,180.7 449 | 1951,Stroke,181.4 450 | 1952,Stroke,180.2 451 | 1953,Stroke,179.2 452 | 1954,Stroke,173.4 453 | 1955,Stroke,177.3 454 | 1956,Stroke,177.4 455 | 1957,Stroke,183 456 | 1958,Stroke,183 457 | 1959,Stroke,179 458 | 1960,Stroke,177.9 459 | 1961,Stroke,173.1 460 | 1962,Stroke,174 461 | 1963,Stroke,173.9 462 | 1964,Stroke,167 463 | 1965,Stroke,166.4 464 | 1966,Stroke,165.8 465 | 1967,Stroke,159.3 466 | 1968,Stroke,162.5 467 | 1969,Stroke,155.4 468 | 1970,Stroke,147.7 469 | 1971,Stroke,147.6 470 | 1972,Stroke,147.3 471 | 1973,Stroke,145.2 472 | 1974,Stroke,136.8 473 | 1975,Stroke,123.5 474 | 1976,Stroke,117.4 475 | 1977,Stroke,110.4 476 | 1978,Stroke,103.7 477 | 1979,Stroke,97.3 478 | 1980,Stroke,96.4 479 | 1981,Stroke,89.7 480 | 1982,Stroke,84.4 481 | 1983,Stroke,81.4 482 | 1984,Stroke,78.9 483 | 1985,Stroke,76.6 484 | 1986,Stroke,73.3 485 | 1987,Stroke,71.8 486 | 1988,Stroke,70.8 487 | 1989,Stroke,67.1 488 | 1990,Stroke,65.5 489 | 1991,Stroke,63.1 490 | 1992,Stroke,61.6 491 | 1993,Stroke,62.9 492 | 1994,Stroke,62.8 493 | 1995,Stroke,63.3 494 | 1996,Stroke,62.6 495 | 1997,Stroke,61.2 496 | 1998,Stroke,59.4 497 | 1900,Tuberculosis,206 498 | 1901,Tuberculosis,200.9 499 | 1902,Tuberculosis,183.8 500 | 1903,Tuberculosis,185.4 501 | 1904,Tuberculosis,195.4 502 | 1905,Tuberculosis,187.3 503 | 1906,Tuberculosis,185.3 504 | 1907,Tuberculosis,185.2 505 | 1908,Tuberculosis,171.6 506 | 1909,Tuberculosis,165.8 507 | 1910,Tuberculosis,163.4 508 | 1911,Tuberculosis,166.1 509 | 1912,Tuberculosis,155.4 510 | 1913,Tuberculosis,154.2 511 | 1914,Tuberculosis,151.9 512 | 1915,Tuberculosis,150.1 513 | 1916,Tuberculosis,149.5 514 | 1917,Tuberculosis,155.3 515 | 1918,Tuberculosis,159.2 516 | 1919,Tuberculosis,135.8 517 | 1920,Tuberculosis,123.2 518 | 1921,Tuberculosis,106.8 519 | 1922,Tuberculosis,105.3 520 | 1923,Tuberculosis,101.4 521 | 1924,Tuberculosis,96.4 522 | 1925,Tuberculosis,93.2 523 | 1926,Tuberculosis,94.4 524 | 1927,Tuberculosis,87.4 525 | 1928,Tuberculosis,86.6 526 | 1929,Tuberculosis,83.1 527 | 1930,Tuberculosis,78.3 528 | 1931,Tuberculosis,74.8 529 | 1932,Tuberculosis,69.3 530 | 1933,Tuberculosis,65.9 531 | 1934,Tuberculosis,62.9 532 | 1935,Tuberculosis,61 533 | 1936,Tuberculosis,61.7 534 | 1937,Tuberculosis,59 535 | 1938,Tuberculosis,53.5 536 | 1939,Tuberculosis,51.5 537 | 1940,Tuberculosis,49.9 538 | 1941,Tuberculosis,48 539 | 1942,Tuberculosis,46.5 540 | 1943,Tuberculosis,45.8 541 | 1944,Tuberculosis,44.4 542 | 1945,Tuberculosis,43 543 | 1946,Tuberculosis,39.5 544 | 1947,Tuberculosis,37.1 545 | 1948,Tuberculosis,33.7 546 | 1949,Tuberculosis,29.4 547 | 1950,Tuberculosis,25.5 548 | 1951,Tuberculosis,23 549 | 1952,Tuberculosis,18.2 550 | 1953,Tuberculosis,14.6 551 | 1954,Tuberculosis,12.1 552 | 1955,Tuberculosis,10.9 553 | 1956,Tuberculosis,10.2 554 | 1957,Tuberculosis,9.5 555 | 1958,Tuberculosis,8.7 556 | 1959,Tuberculosis,8 557 | 1960,Tuberculosis,7.5 558 | 1961,Tuberculosis,6.8 559 | 1962,Tuberculosis,6.4 560 | 1963,Tuberculosis,6.2 561 | 1964,Tuberculosis,5.5 562 | 1965,Tuberculosis,5.2 563 | 1966,Tuberculosis,4.9 564 | 1967,Tuberculosis,4.4 565 | 1968,Tuberculosis,3.9 566 | 1969,Tuberculosis,3.4 567 | 1970,Tuberculosis,3.2 568 | 1971,Tuberculosis,2.7 569 | 1972,Tuberculosis,2.6 570 | 1973,Tuberculosis,2.2 571 | 1974,Tuberculosis,2 572 | 1975,Tuberculosis,1.9 573 | 1976,Tuberculosis,1.7 574 | 1977,Tuberculosis,1.6 575 | 1978,Tuberculosis,1.5 576 | 1979,Tuberculosis,1 577 | 1980,Tuberculosis,1 578 | 1981,Tuberculosis,1 579 | 1982,Tuberculosis,0.9 580 | 1983,Tuberculosis,0.9 581 | 1984,Tuberculosis,0.8 582 | 1985,Tuberculosis,0.8 583 | 1986,Tuberculosis,0.8 584 | 1987,Tuberculosis,0.8 585 | 1988,Tuberculosis,0.8 586 | 1989,Tuberculosis,0.9 587 | 1990,Tuberculosis,0.8 588 | 1991,Tuberculosis,0.7 589 | 1992,Tuberculosis,0.7 590 | 1993,Tuberculosis,0.7 591 | 1994,Tuberculosis,0.6 592 | 1995,Tuberculosis,0.6 593 | 1996,Tuberculosis,0.5 594 | 1997,Tuberculosis,0.4 595 | 1998,Tuberculosis,0.4 596 | -------------------------------------------------------------------------------- /Joinpoint Regression in R.R: -------------------------------------------------------------------------------- 1 | ### JOINPOINT ANALYSES IN R 2 | 3 | # Taylor P. van Doren 4 | # October 21, 2021 5 | 6 | ### INTRODUCTION ---- 7 | 8 | # This file goes through the analytical procedure and data visualization of 9 | # joinpoint regression all in R. 10 | # There is a dedicated Joinpoint Regression Program that you can use to run 11 | # the same analyses and was built 12 | # specifically for this regression method, and that procedure has been 13 | # outlined in another file in this 14 | # Github repository using the exact same data that we will use in this file. 15 | 16 | # We will only need one package for this regression method: ljr 17 | # "ljr" stands for logistic joinpoint regression. 18 | # This means that these results are fit in a logistic model, 19 | # but we could absolutely fit the model in the dedicated 20 | # Joinpoint Regression Program without this logistic transformation. 21 | # We could also theoretically transform the results of this analysis in R 22 | # out of the logistic form, but we won't do that. 23 | 24 | ### JOINPOINT REGRESSION BASICS ---- 25 | 26 | # The general joinpoint regression equation is: 27 | # y(fit) = Beta0 + Beta1*x + delta1(x - tau1) + ... + Deltak(x - tauk) + error 28 | # y(fit) = fitted y values 29 | # Beta0 = y intercept 30 | # Beta1 = slope estimate before any joinpoints 31 | # delta1 = slope estimate after a joinpoint or between two joinpoints 32 | # tauk = the location of the estimated joinpoint 33 | 34 | # Remember, however, this package uses a logistic transformation on our data to 35 | # fit these models, so instead of fitting 36 | # y = xb, we are rather fitting ln(y) = xb. 37 | 38 | ### DATA SETUP ---- 39 | 40 | # First, let's load our libraries and the data we'll need. 41 | 42 | library(ljr) 43 | library(dplyr) 44 | library(reshape2) 45 | library(ggplot2) 46 | library(tidyr) 47 | library(ggsci) 48 | # (that's it!) 49 | # yearly mortality rate for major causes of death in US 1990-1998 50 | mortdata <- read.csv("mortality data.csv") 51 | # yearly US population size 1900-1998 52 | pop <- read.csv("usa pop.csv") 53 | 54 | # the max age-specific death rate in this data is 612.4 deaths per 100,000 55 | # that's P&I during the 1918 influenza pandemic! 56 | summary(mortdata) 57 | 58 | # Major causes of death we're looking at: 59 | # 1. Accidents 60 | # 2. Cancer 61 | # 3. Heart disease 62 | # 4. Influenza & Pneumonia (P&I) 63 | # 5. Stroke 64 | # 6. Tuberculosis (TB) 65 | 66 | # Let's plot the data first to see what kinds of patterns we can identify 67 | # without doing any modeling yet. 68 | # (can you find the dot for the 1918 influenza pandemic?) 69 | 70 | ggplot(mortdata, aes(year, asdr, color = cod)) + 71 | geom_point(size = 2, shape = 16, alpha = 0.6) + 72 | geom_smooth(alpha = 0) + 73 | theme_classic() + 74 | xlab("Year") + 75 | ylab("Age-Adjusted Death Rate (per 100,000)") + 76 | scale_color_jco() 77 | 78 | # And the same figure again with a log transformation 79 | # (so we can better prepare for the following logistic analyses) 80 | 81 | mortdata$asdrlog <- log(mortdata$asdr) 82 | ggplot(mortdata, aes(year, asdr, color = cod)) + 83 | geom_point(size = 2, shape = 16, alpha = 0.6) + 84 | geom_smooth(alpha = 0) + 85 | theme_classic() + 86 | xlab("Year") + 87 | ylab("Age-Adjusted Death Rate (per 100,000)") + 88 | scale_color_jco() + 89 | scale_y_log10() 90 | 91 | # Looking at this figure, we will be able to make some pretty good educated 92 | # guesses about where we might find joinpoints. 93 | # For example, TB declined SO MUCH during the 20th century! 94 | # Where did it decline, exactly? If you want to know a lot more 95 | # detail about that, check out Noymer (2009) 96 | # "Testing the influenza-tuberculosis selective mortality hypothesis with 97 | # Union Army data", Noymer (2011) 98 | # "The 1918 influenza pandemic hastened the decline of tuberculosis 99 | # in the United States: An age, period, cohort analysis", and 100 | # van Doren & Sattenspiel (2021) "The 1918 influenza pandemic did not 101 | # accelerate tuberculosis mortality decline in early-20th century 102 | # Newfoundland: Investigating historical and social explanations." 103 | 104 | # Aside from that, it looks like there was a major decline in P&I before 105 | # mid-century, some decline in accidents in the 1970s, 106 | # and a big increase and then decrease through mid-century in heart disease, 107 | # a really fascinating epidemiological phenomenon 108 | # that was described by Gage (2005) 109 | # "Are modern environments really bad for us?: Revisiting the demographic 110 | # and epidemiologic transitions." 111 | 112 | # I like to start with these initial visualizations in order to get a sense 113 | # of where we are going before we start going 114 | # there. It helps develop intuition about statistical modeling and helps us 115 | # really check to see if we understand the results we get. 116 | 117 | # Right now, mortdata is organized in a long format, 118 | # but for this analysis it will be better to have it in wide format. 119 | 120 | # As we will see in a few moments, the ljr() functions do not take mortality 121 | # rates as arguments! What we will instead input as arguments are the number 122 | # of deaths and the population size. Now, we need to back-calculate the 123 | # number of deaths from each cause in each year using the yearly population 124 | # of the US to do so. 125 | 126 | mdw <- mortdata %>% 127 | select(year, cod, r = asdr) %>% 128 | # combine the pop data with the mortality rate data 129 | left_join(pop, by = "year") %>% 130 | # back calculate number of deaths 131 | mutate(n = r / 100000 * pop) %>% 132 | # rename cod to more convenient names 133 | mutate(cod = case_when( 134 | cod == "Accidents" ~ "accidents", 135 | cod == "Cancer" ~ "cancer", 136 | cod == "Heart Disease" ~ "heart", 137 | cod == "Influenza and Pneumonia" ~ "pi", 138 | cod == "Stroke" ~ "stroke", 139 | cod == "Tuberculosis" ~ "tb" 140 | )) %>% 141 | # shape to wide 142 | pivot_wider( 143 | names_from = "cod", values_from = c("r", "n"), 144 | names_glue = "{cod}.{.value}") 145 | 146 | # Let's plot a couple real quick to make sure we have what we need 147 | 148 | plot(mdw$pi.n) 149 | plot(mdw$heart.n) 150 | plot(mdw$tb.n) 151 | 152 | ### LOGISTIC JOINPOINT MODELING ---- 153 | 154 | # Fitting the data, finding the joinpoints. 155 | 156 | # the 'ljr' package contains a number of built-in functions, but we will be 157 | # working with only three: 158 | # 1. ljr0() : fits zero joinpoints - just a straight line! 159 | # 2. ljr1() : fits a single joinpoint at the most significant point of 160 | # change over the time period 161 | # 3. ljrk() : fits as many joinpoints as you want! 162 | # WARNING: ANYTHING OVER 3 CAN TAKE A LONG TIME 163 | # And obviously: be careful about overfitting your model! 164 | 165 | # Let's run a few of these models to see what the outputs look like. 166 | # One of the great things about these models is that the output is 167 | # very short and very intuitive. They also print automatically! 168 | 169 | 170 | # We'll use P&I first 171 | # arguments: number of deaths, population size 172 | # (denominator of mortality rate), time 173 | # the output of this fit is super straightforward: 174 | # we have a y-intercept of 46.75... and a slope of -0.027... 175 | # you can index these values easily as well 176 | fit.1 <- ljr0(mdw$pi.n, mdw$pop, mdw$year) 177 | 178 | # arguments: number of deaths, population size, time 179 | # summ parameter automatically print summary table 180 | # now, we have a y-int of -15.61... and some other things! 181 | # g0 is the slope of the line before any joinpoints are identified. 182 | # g1 max(t-tau1,0) 183 | # is the slope of the line after the joinpoint is identified. 184 | # we also have our first tau (joinpoint) estimate: 1918! 185 | fit.2 <- ljr1(mdw$pi.n, mdw$pop, mdw$year, summ = TRUE) 186 | 187 | # arguments: number of joinpoints to find (k), 188 | # number of deaths, population size, time 189 | # y-intercept: -27.9... 190 | # g0: slope from 1900-1918: 0.0115 191 | # g1 max(t-tau1,0), slope from 1919-1956: 0.0337 192 | # g2 max(t-tau2,0), slope from 1957-1998: -0.058 193 | # what this means is that after 1956 P&I deaths decreased a lot! 194 | fit.3 <- ljrk(2, mdw$pi.n, mdw$pop, mdw$year) 195 | 196 | # arguments: number of joinpoints to find (k), 197 | # number of deaths, population size, time 198 | # If you ran this model, you likely noticed how much SLOWER it was. 199 | # You can ask the model to fit as many joinpoints as your heart desires. 200 | # But you have to think about whether this is a smart thing to do or 201 | # not, and what it would mean to fit all those points. It would end up 202 | # being likely pretty meaningless. So take a look at this output and see 203 | # if you can interpret it. 204 | fit.4 <- ljrk(3, mdw$pi.n, mdw$pop, mdw$year) 205 | 206 | 207 | 208 | # Since we want to be able to do all of this more quickly without writing four 209 | # different models for every cause of death, 210 | # let's write a function instead that will do everything we want, 211 | # including extracting those tau estimates 212 | # so we can easily index them for data visualization 213 | 214 | jp.calc <- function(exp.deaths, pop, time) { 215 | 216 | # argument definitions 217 | # exp.deaths: a vector with the number of deaths that are expected to occur 218 | # within the set period of time (number of deaths for a specific cause 219 | # in one year, for example) 220 | # pop: the population size over the defined period of time (e.g., one year) 221 | # time: a vector with the time series over which the rates of interest occur 222 | # (e.g., the study period here is yearly 1900-2000, so 1900, 1901, 1902, 223 | # and so on) 224 | 225 | # calculate the joinpoint estimates for each cause of death, 0-3 226 | x0 <- ljr0(exp.deaths, pop, time) 227 | x1 <- ljr1(exp.deaths, pop, time, summ = T) 228 | x2 <- ljrk(2, exp.deaths, pop, time) 229 | x3 <- ljrk(3, exp.deaths, pop, time) 230 | 231 | # print the list of coefficients (slopes between joinpoints) 232 | print(list(x0$Coef, x1$Coef, x2$Coef, x3$Coef)) 233 | 234 | # print the list of joinpoints for the 1, 2, 3 joinpoint models 235 | print(list(x1$Joinpoint, x2$Joinpoints, x3$Joinpoints)) 236 | 237 | } 238 | 239 | # Fit all the models! 240 | 241 | accidents.calc <- jp.calc(mdw$accidents.n, mdw$pop, mdw$year) 242 | cancer.calc <- jp.calc(mdw$cancer.n, mdw$pop, mdw$year) 243 | heart.calc <- jp.calc(mdw$heart.n, mdw$pop, mdw$year) 244 | pi.calc <- jp.calc(mdw$pi.n, mdw$pop, mdw$year) 245 | stroke.calc <- jp.calc(mdw$stroke.n, mdw$pop, mdw$year) 246 | tb.calc <- jp.calc(mdw$tb.n, mdw$pop, mdw$year) 247 | 248 | # run them all and then make yourself some coffee 249 | # they'll be done when you get back 250 | 251 | 252 | 253 | ### MAKING SENSE OF THE MODEL FITS ---- 254 | 255 | # Remember that each model itself prints its output automatically, 256 | # so by running the function that we wrote 257 | # with each of the models inside of it, 258 | # every time you run the function you should get the four model 259 | # outputs individually, along with the slope estimates for each of the 260 | # segments of the fitted model and, finally, the indexable tau (joinpoint) 261 | # values. This is what we will use to visualize our data. 262 | 263 | # when I simply print the name of the object, 264 | # what comes up is the list of joinpoint estimates. 265 | heart.calc 266 | # you can index these easily: 267 | heart.calc[[1]] 268 | heart.calc[[2]] 269 | heart.calc[[3]] 270 | 271 | 272 | # Let's make tables of all the joinpoint estimates 273 | death.cause <- c("accidents", "cancer", "heart disease", "P&I", "stroke", "TB") 274 | one.joinpoint <- data.frame( 275 | accidents.calc[[1]], cancer.calc[[1]], heart.calc[[1]], pi.calc[[1]], 276 | stroke.calc[[1]], tb.calc[[1]]) 277 | colnames(one.joinpoint) <- death.cause 278 | two.joinpoints <- data.frame( 279 | accidents.calc[[2]], cancer.calc[[2]], heart.calc[[2]], pi.calc[[2]], 280 | stroke.calc[[2]], tb.calc[[2]]) 281 | colnames(two.joinpoints) <- death.cause 282 | three.joinpoints <- data.frame( 283 | accidents.calc[[3]], cancer.calc[[3]], heart.calc[[3]], pi.calc[[3]], 284 | stroke.calc[[3]], tb.calc[[3]]) 285 | colnames(three.joinpoints) <- death.cause 286 | 287 | jp.summary <- list(one.joinpoint, two.joinpoints, three.joinpoints) 288 | jp.summary 289 | 290 | # Time to visualize what we have here 291 | # Before we do that, it's important to remember that although we INPUT the data 292 | # as number of deaths and population size, the model used that information 293 | # and fit them as though they were rates. So, we'll need to PLOT the log 294 | # transformed mortality rates, and then visualize the joinpoint estimates 295 | 296 | 297 | 298 | accidents.plot <- ggplot(mdw, aes(year, accidents.r)) + 299 | geom_point(shape = 21, size = 3.5, color = "black", fill = "darkgrey", alpha = 0.6) + 300 | theme_classic() + 301 | xlab("Year") + 302 | ylab("Accident Mortality") + 303 | scale_y_log10() 304 | 305 | # Now we'll add vertical lines where the models have estimated there are 306 | # significant changes in mortality rates 307 | 308 | # One-joinpoint model: 309 | accidents.plot + 310 | geom_vline(xintercept = accidents.calc[[1]], size = 1.2, color = "#5C6BC0") 311 | 312 | # Two-joinpoint model 313 | accidents.plot + 314 | geom_vline(xintercept = accidents.calc[[2]], size = 1.2, color = "#26C6DA") 315 | 316 | # Three-joinpoint model 317 | accidents.plot + 318 | geom_vline(xintercept = accidents.calc[[3]], size = 1.2, color = "#FFA726") 319 | 320 | # One of the things that you might have noticed by now, if not by looking at the 321 | # list output of the jp.calc() runs, but certainly by visualizing the data 322 | # and the estimated points of change, the joinpoint estimates are 323 | # not necessarily the same from each fit to the next. As seen above for the 324 | # accidents mortality data, there is always a joinpoint estimated somewhere 325 | # around 1970, but it is never the exact same x value every single time. 326 | # This is because the joinpoint estimates are highly dependent on where the 327 | # preceding point is estimated, if there is a preceding point. 328 | 329 | # As we can see by the list output, if there is only one joinpoint, the most 330 | # significant point of change is in 1968. But when there is a joinpoint 331 | # estimated BEFORE that time, then the estimate changes to 1971. 332 | # When TWO points are estimated before that, then the estimate is 1967. 333 | accidents.calc 334 | 335 | 336 | # We can visualize them all together on the same plot 337 | accidents.plot + 338 | geom_vline(xintercept = accidents.calc[[1]], size = 1.2, color = "#5C6BC0") + 339 | geom_vline(xintercept = accidents.calc[[2]], size = 1.2, color = "#26C6DA") + 340 | geom_vline(xintercept = accidents.calc[[3]], size = 1.2, color = "#FFA726") + 341 | ggtitle("Accidents") 342 | 343 | 344 | # Let's finish by visualizing the rest of our model fits. 345 | 346 | # CANCER 347 | 348 | cancer.plot <- ggplot(mdw, aes(year, cancer.r)) + 349 | geom_point(shape = 21, size = 3.5, color = "black", fill = "darkgrey") + 350 | theme_classic() + 351 | xlab("Year") + 352 | ylab("Cancer Mortality") + 353 | scale_y_log10() 354 | 355 | cancer.plot + 356 | geom_vline(xintercept = cancer.calc[[1]], size = 1.2, color = "#5C6BC0") + 357 | geom_vline(xintercept = cancer.calc[[2]], size = 1.2, color = "#26C6DA") + 358 | geom_vline(xintercept = cancer.calc[[3]], size = 1.2, color = "#FFA726") + 359 | ggtitle("Cancer") 360 | 361 | # in the cancer plot, you can't even see the single joinpoint estimate because 362 | # it is so close to the other estimates of the other models! 363 | cancer.calc 364 | 365 | # HEART DISEASE 366 | 367 | heart.plot <- ggplot(mdw, aes(year, heart.r)) + 368 | geom_point(shape = 21, size = 3.5, color = "black", fill = "darkgrey") + 369 | theme_classic() + 370 | xlab("Year") + 371 | ylab("Heart Disease Mortality") + 372 | scale_y_log10() 373 | 374 | heart.plot + 375 | geom_vline(xintercept = heart.calc[[1]], size = 1.2, color = "#5c6bc0") + 376 | geom_vline(xintercept = heart.calc[[2]], size = 1.2, color = "#26c6da") + 377 | geom_vline(xintercept = heart.calc[[3]], size = 1.2, color = "#ffa726") + 378 | ggtitle("Heart Disease") 379 | 380 | # INFLUENZA & PNEUMONIA 381 | 382 | pi.plot <- ggplot(mdw, aes(year, pi.r)) + 383 | geom_point(shape = 21, size = 3.5, color = "black", fill = "darkgrey") + 384 | theme_classic() + 385 | xlab("Year") + 386 | ylab("Influenza & Pneumonia Mortality") + 387 | scale_y_log10() 388 | 389 | pi.plot + 390 | geom_vline(xintercept = pi.calc[[1]], size = 1.2, color = "#5c6bc0") + 391 | geom_vline(xintercept = pi.calc[[2]], size = 1.2, color = "#26c6da") + 392 | geom_vline(xintercept = pi.calc[[3]], size = 1.2, color = "#ffa726") + 393 | ggtitle("Influenza & Pneumonia") 394 | 395 | # STROKE 396 | 397 | stroke.plot <- ggplot(mdw, aes(year, stroke.r)) + 398 | geom_point(shape = 21, size = 3.5, color = "black", fill = "darkgrey") + 399 | theme_classic() + 400 | xlab("Year") + 401 | ylab("Stroke Mortality") + 402 | scale_y_log10() 403 | 404 | stroke.plot + 405 | geom_vline(xintercept = stroke.calc[[1]], size = 1.2, color = "#5c6bc0") + 406 | geom_vline(xintercept = stroke.calc[[2]], size = 1.2, color = "#26c6da") + 407 | geom_vline(xintercept = stroke.calc[[3]], size = 1.2, color = "#ffa726") + 408 | ggtitle("Stroke") 409 | 410 | # TUBERCULOSIS 411 | 412 | tb.plot <- ggplot(mdw, aes(year, tb.r)) + 413 | geom_point(shape = 21, size = 3.5, color = "black", fill = "darkgrey") + 414 | theme_classic() + 415 | xlab("Year") + 416 | ylab("Tuberculosis Mortality") + 417 | scale_y_log10() 418 | 419 | tb.plot + 420 | geom_vline(xintercept = tb.calc[[1]], size = 1.2, color = "#5c6bc0") + 421 | geom_vline(xintercept = tb.calc[[2]], size = 1.2, color = "#26c6da") + 422 | geom_vline(xintercept = tb.calc[[3]], size = 1.2, color = "#ffa726") + 423 | ggtitle("Tuberculosis") 424 | 425 | -------------------------------------------------------------------------------- /model fits.csv: -------------------------------------------------------------------------------- 1 | year,accidents.obs,accidents.0,accidents.1,accidents.2,accidents.3,cancer.obs,cancer.0,cancer.1,cancer.2,cancer.3,heart.obs,heart.0,heart.1,heart.2,heart.3,pi.obs,pi.0,pi.1,pi.2,pi.3,stroke.obs,stroke.0,stroke.1,stroke.2,stroke.3,tb.obs,tb.0,tb.1,tb.2,tb.3 2 | 1900,90.3,111.38,94.46,94.23,93.93,114.8,140.78,116.9,117.31,116.92,265.4,426.26,279.91,270.27,291.6,297.5,268.73,314.34,246.4,284.4,244.2,265.79,251.27,261.29,244.8,206,160.3,200.23,208.59,199.38 3 | 1901,109.3,110.57,98.32,98.19,98.07,118.1,141.62,119.11,119.47,119.12,272.6,426.52,285.92,276.88,295.95,312.9,265.69,309.53,248.09,279.09,243.6,263.81,249.81,259.29,244.31,200.9,158.2,196.51,204.28,196.36 4 | 1902,93.6,109.77,102.18,102.15,102.21,119.1,142.47,121.31,121.63,121.33,285.2,426.78,291.94,283.5,300.29,219.3,262.65,304.71,249.78,273.79,237.8,261.83,248.34,257.29,243.81,183.8,156.09,192.8,199.97,193.34 5 | 1903,106.9,108.97,106.03,106.11,106.36,125.2,143.32,123.52,123.79,123.53,304.5,427.04,297.95,290.11,304.64,251.1,259.61,299.9,251.48,268.48,244.6,259.85,246.88,255.29,243.32,185.4,153.99,189.08,195.66,190.33 6 | 1904,112.8,108.17,109.89,110.08,110.5,127.9,144.17,125.73,125.95,125.74,331.5,427.3,303.96,296.73,308.98,291.2,256.57,295.08,253.17,263.18,255.2,257.87,245.42,253.29,242.83,195.4,151.89,185.36,191.35,187.31 7 | 1905,108.5,107.36,109.06,114.04,114.65,132.5,145.02,127.93,128.11,127.94,327.8,427.56,309.97,303.35,313.33,257.8,253.53,290.26,254.86,257.87,247.3,255.89,243.96,251.29,242.34,187.3,149.79,181.65,187.04,184.29 8 | 1906,121.2,106.56,108.23,118,118.79,128.8,145.87,130.14,130.27,130.14,325.5,427.82,315.98,309.96,317.67,222.5,250.49,285.45,256.55,252.57,245.9,253.91,242.49,249.29,241.85,185.3,147.68,177.93,182.72,181.28 9 | 1907,122.3,105.75,107.4,116.23,116.81,133,146.71,132.34,132.43,132.35,356.5,428.08,321.99,316.58,322.02,285.4,247.46,280.63,258.24,247.26,261.8,251.93,241.03,247.29,241.36,185.2,145.58,174.22,178.41,178.26 10 | 1908,108.8,104.96,106.57,114.45,114.84,134.5,147.56,134.55,134.59,134.55,328.6,428.34,328.01,323.19,326.37,234.6,244.42,275.81,259.94,241.96,239,249.95,239.57,245.29,240.87,171.6,143.48,170.5,174.1,175.24 11 | 1909,108,104.15,105.74,112.68,112.86,138.1,148.41,136.75,136.75,136.75,329.2,428.6,334.02,329.81,330.71,221.2,241.38,271,261.63,236.66,237.5,247.97,238.11,243.29,240.38,165.8,141.38,166.78,169.79,172.22 12 | 1910,111.2,103.35,104.91,110.91,110.88,143.1,149.26,138.96,138.92,138.96,345.1,428.85,340.03,336.42,335.06,238.4,238.34,266.18,263.32,231.35,238.5,245.99,236.65,241.29,239.89,163.4,139.27,163.07,165.48,169.21 13 | 1911,113.5,102.55,104.08,109.14,108.91,140.4,150.11,141.17,141.08,141.16,341.8,429.11,346.04,343.04,339.4,234.1,235.3,261.36,265.01,226.05,230.2,244.01,235.18,239.29,239.4,166.1,137.17,159.35,161.17,166.19 14 | 1912,107.1,101.75,103.25,107.37,106.93,144.7,150.96,143.37,143.24,143.37,346,429.37,352.05,349.65,343.75,213.7,232.26,256.55,266.7,220.74,228.7,242.03,233.72,237.29,238.91,155.4,135.07,155.63,156.85,163.17 15 | 1913,108.2,100.94,102.42,105.6,104.96,147.8,151.81,145.58,145.4,145.57,337.9,429.63,358.06,356.27,348.09,214.8,229.22,251.73,268.4,215.44,226.9,240.05,232.26,235.29,238.42,154.2,132.97,151.92,152.54,160.16 16 | 1914,100.4,100.14,101.59,103.82,102.98,146.6,152.65,147.78,147.56,147.77,346.4,429.89,364.08,362.89,352.44,202.4,226.18,246.91,270.09,210.13,231.3,238.07,230.8,233.29,237.92,151.9,130.86,148.2,148.23,157.14 17 | 1915,95.2,99.34,100.76,102.05,101,149.5,153.5,149.99,149.72,149.98,361.5,430.15,370.09,369.5,356.79,238.1,223.14,242.1,271.78,233.05,234.5,236.09,229.33,231.29,237.43,150.1,128.76,144.48,143.92,154.12 18 | 1916,104.3,98.54,99.93,100.28,99.03,152.2,154.35,152.19,151.88,152.18,373.3,430.41,376.1,376.12,361.13,278.5,220.1,237.28,273.47,255.98,235.7,234.11,227.87,229.29,236.94,149.5,126.66,140.77,139.61,151.1 19 | 1917,107,97.73,99.1,98.51,97.05,150.7,155.2,154.4,154.04,154.39,377.9,430.57,382.11,382.73,365.48,267,217.06,232.47,275.16,278.9,238.2,232.13,226.41,227.29,236.45,155.3,124.56,137.05,135.3,148.09 20 | 1918,99.9,96.93,98.27,96.74,95.07,148.4,156.05,156.61,156.2,156.59,366.2,430.93,388.12,389.35,369.82,612.4,214.02,227.54,276.86,301.82,228,230.15,224.95,225.29,235.96,159.2,122.45,133.33,130.98,145.07 21 | 1919,86.9,96.13,97.44,94.96,93.1,152.1,156.9,158.81,158.36,158.79,335.7,431.19,394.14,395.96,374.17,270.9,210.99,222.83,269.53,293.36,225.6,228.17,223.48,223.29,235.47,135.8,120.35,129.62,126.67,133.9 22 | 1920,87.5,95.33,96.61,93.19,91.12,159,157.75,161.02,160.53,161,375,431.45,400.15,402.58,378.52,279.2,207.95,218.02,262.2,284.89,238.5,226.19,222.02,221.29,234.98,123.2,118.25,125.9,122.36,122.74 23 | 1921,83.2,94.52,95.78,92.43,89.15,163.5,158.59,163.22,162.69,163.2,366.2,431.71,406.16,409.19,387.93,153.1,204.91,213.2,254.88,276.43,230.1,224.21,220.56,219.29,234.49,106.8,116.15,122.19,118.05,111.57 24 | 1922,85.4,93.72,94.95,91.67,88.56,165.6,159.44,165.43,164.85,165.4,392.1,431.97,412.17,415.81,397.35,207.6,201.87,208.38,247.55,267.97,238.9,222.23,219.1,217.29,234,105.3,114.04,118.47,113.74,100.41 25 | 1923,91.2,92.92,94.12,90.91,87.87,168.8,160.29,167.63,167.01,167.61,410.3,432.23,418.18,422.43,406.77,253,198.83,203.57,240.23,259.5,234.6,220.25,217.64,215.29,233.51,101.4,111.94,114.75,109.43,97.72 26 | 1924,89.6,92.12,93.28,90.15,87.38,170.6,161.14,169.84,169.17,169.81,410.5,432.49,424.19,429.04,416.19,182,195.79,198.75,232.9,251.04,246.4,218.27,216.17,213.29,233.02,96.4,109.84,111.04,105.11,95.04 27 | 1925,92.2,91.31,92.45,89.39,86.79,174.3,161.99,172.05,171.33,172.02,433.8,432.75,430.21,435.66,425.61,198.1,192.75,193.93,225.58,242.58,227.9,216.29,214.71,211.29,228.56,93.2,107.74,107.32,100.8,92.35 28 | 1926,89.8,90.51,91.62,88.63,86.2,177.3,162.84,174.25,173.49,174.22,465.7,433.01,436.22,442.27,435.03,233,189.71,189.12,218.25,234.11,228.2,214.31,213.25,209.29,224.1,94.4,105.63,103.6,96.49,89.67 29 | 1927,86.3,89.71,90.79,87.87,85.61,177.8,163.69,176.46,176.65,176.42,448.8,433.27,442.23,448.89,444.45,164,186.67,184.3,210.92,225.65,216.3,212.33,211.79,207.29,219.64,87.4,103.53,99.89,92.18,86.99 30 | 1928,86.1,88.91,89.96,87.11,85.02,177.8,164.53,178.66,177.81,178.63,478.9,433.53,448.24,455.5,453.86,236.4,183.63,179.49,203.6,217.19,223.4,210.35,210.32,205.29,215.19,86.6,101.43,96.17,87.87,84.3 31 | 1929,84.3,88.1,89.13,86.34,84.43,175.3,165.38,179.17,178.37,179.13,476.2,433.79,454.25,462.12,463.28,247.5,180.59,174.67,196.27,208.72,213.3,208.37,208.86,203.29,210.73,83.1,99.32,92.45,83.56,81.62 32 | 1930,84.2,87.3,88.3,85.58,83.84,174.5,166.23,179.68,178.92,179.63,467.9,434.05,460.26,468.74,472.7,159.8,177.55,169.85,188.95,200.26,203.9,206.4,207.4,201.29,206.27,78.3,97.22,88.74,79.25,78.93 33 | 1931,81.2,86.5,87.47,84.82,83.25,175.8,167.08,180.19,179.47,180.13,459.6,434.31,466.28,475.35,482.12,170.2,174.51,165.04,181.62,191.8,195,204.42,205.94,199.29,201.81,74.8,95.12,85.02,74.93,76.25 34 | 1932,76.6,85.7,86.64,84.06,82.66,179.2,167.93,180.69,180.02,180.62,482.8,434.57,472.29,481.97,491.54,180,171.48,160.22,174.29,183.33,194.4,202.44,204.47,197.29,197.36,69.3,93.02,81.3,70.62,73.56 35 | 1933,76.2,84.89,85.81,83.3,82.07,178.2,168.78,181.2,180.58,181.12,483.8,434.83,478.3,488.58,500.96,156.5,168.44,155.4,166.97,174.87,185,200.46,203.01,195.29,192.9,65.9,90.91,77.59,68.14,70.88 36 | 1934,82.7,84.09,84.98,82.54,81.48,181.6,169.63,181.71,181.13,181.62,502.9,435.09,484.31,495.2,510.38,152.9,165.4,150.59,159.64,166.41,184.5,198.48,201.55,193.29,188.44,62.9,88.81,73.87,65.66,68.19 37 | 1935,80.8,83.29,84.15,81.78,80.89,183.4,170.47,182.21,181.68,182.12,506.8,435.35,490.32,501.81,519.79,163.8,162.36,145.77,152.32,157.94,181.2,196.5,200.09,191.29,183.99,61,86.71,70.16,63.18,65.51 38 | 1936,92.4,82.49,83.32,81.02,80.3,186.8,171.32,182.72,182.23,182.62,546.2,435.61,496.33,508.43,529.21,186.7,159.31,140.95,144.99,149.48,189.8,194.52,198.63,189.29,179.53,61.7,84.61,66.44,60.69,62.83 39 | 1937,81.8,81.68,82.49,80.26,79.71,184.6,172.17,183.23,182.78,183.12,538.8,435.87,502.35,515.04,538.63,181.8,156.28,136.14,137.67,141.02,176.6,192.54,197.16,187.29,175.07,59,82.5,62.72,58.21,60.14 40 | 1938,76.5,80.88,81.66,79.5,79.12,185.7,173.02,183.74,183.34,183.62,528.9,436.12,508.36,521.66,539.89,124.3,153.24,131.32,130.34,132.55,171.4,190.56,195.7,185.29,170.61,53.5,80.4,59.01,55.73,57.46 41 | 1939,74.7,80.08,80.83,78.73,78.53,187.1,173.87,184.24,183.89,184.12,534.5,436.38,514.37,528.28,541.16,124.4,150.2,126.51,123.01,124.09,173.2,188.58,194.24,183.29,166.16,51.5,78.3,55.29,53.25,54.77 42 | 1940,76,79.28,80,77.97,77.94,187.8,174.72,184.75,184.44,184.62,558.5,436.64,520.38,534.89,542.42,117.6,147.16,121.69,115.69,115.63,177.2,186.6,192.78,181.29,166.85,49.9,76.2,51.57,50.76,52.09 43 | 1941,72.7,78.47,79.17,77.21,77.35,184.1,175.57,185.26,184.99,185.12,537.9,436.9,526.39,541.51,543.68,104.6,144.12,116.87,108.36,107.16,169.4,184.62,191.31,179.29,167.54,48,74.09,47.86,48.28,49.4 44 | 1942,75.6,77.67,78.34,76.45,76.76,183.8,176.41,185.77,185.55,185.62,531.7,437.16,532.4,548.12,544.94,84.7,141.08,112.06,101.04,98.7,166.8,182.64,189.85,177.29,168.24,46.5,71.99,44.14,45.8,46.72 45 | 1943,82.1,76.87,77.51,75.69,76.18,183.9,177.26,186.27,186.1,186.12,567.5,437.42,538.42,554.74,546.2,101.7,138.04,107.24,93.71,90.24,173.3,180.66,188.39,175.29,168.93,45.8,69.89,40.42,43.32,44.03 46 | 1944,77,76.07,76.68,74.93,75.59,183.8,178.11,186.78,186.65,186.62,541.1,437.68,544.43,555.13,547.47,94.7,135.01,102.42,86.39,81.77,164.4,178.68,186.93,173.29,169.63,44.4,67.79,36.71,40.84,41.35 47 | 1945,74.9,75.26,75.85,74.17,75,186.9,178.96,187.29,187.2,187.11,533.2,437.94,550.44,555.53,548.73,74.9,131.97,97.61,79.06,73.31,166.7,176.7,185.46,171.29,170.32,43,65.68,32.99,38.35,38.67 48 | 1946,69.4,74.46,75.02,73.41,74.41,187.1,179.81,187.8,187.76,187.61,527.7,438.2,556.45,555.92,549.99,69.9,128.93,92.79,71.73,64.85,158.8,174.72,184,169.29,171.02,39.5,63.58,29.27,35.87,35.98 49 | 1947,69.9,73.66,74.19,72.65,73.82,190.7,180.66,188.3,188.31,188.11,552.5,438.46,562.46,556.32,551.25,65.9,125.89,87.97,64.41,56.39,161.3,172.74,182.54,167.29,171.71,37.1,61.48,25.56,33.39,33.3 50 | 1948,68.6,72.86,73.36,71.89,73.23,193.4,181.51,188.81,188.86,188.61,549,438.72,568.47,556.72,552.52,58,122.85,83.16,57.08,47.92,157.4,170.76,181.08,168.7,172.4,33.7,59.38,21.84,30.91,30.61 51 | 1949,57.6,72.05,72.53,71.12,72.64,193.9,182.35,189.32,189.41,189.11,581,438.98,574.49,557.11,553.78,45.1,119.81,78.34,49.76,47.58,176.2,168.78,179.62,170.12,173.1,29.4,57.27,18.13,28.42,27.93 52 | 1950,78.4,71.25,71.7,70.36,72.05,193.9,183.2,189.83,189.96,189.61,588.8,439.24,580.5,557.51,555.04,48.1,116.77,73.53,49.35,47.24,180.7,166.8,178.15,171.53,173.79,25.5,55.17,14.41,25.94,25.24 53 | 1951,79.7,70.45,70.87,69.6,71.46,192,184.05,190.33,190.52,190.11,577.9,439.5,586.51,557.9,556.3,47.4,113.73,68.71,48.95,46.9,181.4,164.82,176.69,172.95,174.49,23,53.07,10.69,23.46,22.56 54 | 1952,78,69.64,70.03,68.84,70.87,194.2,184.9,190.84,191.07,190.61,568.8,439.76,592.52,558.3,557.56,43.1,110.69,63.89,48.54,46.56,180.2,162.84,175.23,174.36,175.18,18.2,50.96,10.41,20.98,19.88 55 | 1953,75.4,68.84,69.2,68.08,70.28,194.6,185.75,191.35,191.62,191.11,570.1,440.02,598.53,558.69,558.83,49.2,107.65,59.08,48.13,46.22,179.2,160.86,173.77,175.77,175.88,14.6,48.86,10.13,18.5,17.19 56 | 1954,69.9,68.04,68.37,67.32,69.69,194.3,186.6,191.86,192.17,191.61,544.6,440.28,604.54,559.09,560.09,36.2,104.61,54.26,47.73,45.88,173.4,158.88,172.3,177.19,176.57,12.1,46.76,9.85,16.01,14.51 57 | 1955,70.9,67.24,67.54,66.56,69.1,194.5,187.45,192.36,192.73,192.11,556.7,440.54,597.01,559.48,561.35,39.2,101.57,49.44,47.32,45.55,177.3,156.9,170.84,178.6,177.27,10.9,44.66,9.57,13.53,11.82 58 | 1956,70.2,66.43,66.71,65.8,68.51,195.6,188.29,192.87,193.28,192.61,560.6,440.8,589.47,559.88,562.61,40.8,98.53,48.97,46.92,45.21,177.4,154.92,169.38,180.02,177.96,10.2,42.55,9.29,11.05,9.14 59 | 1957,69.1,65.63,65.88,65.04,67.92,195.4,189.14,193.38,193.83,193.11,568.5,441.06,581.93,560.27,563.87,50.3,95.5,48.49,46.51,44.87,183,152.94,167.92,181.43,178.65,9.5,40.45,9.01,8.57,6.45 60 | 1958,63.6,64.83,65.05,64.28,67.33,192,189.99,193.89,194.38,193.6,563.6,441.32,574.39,560.67,565.14,47.4,92.46,48.01,46.11,44.53,183,150.96,166.45,182.84,179.35,8.7,38.35,8.73,6.08,6.27 61 | 1959,63.2,64.03,64.22,63.51,66.74,191.6,190.84,194.39,194.94,194.1,552.1,441.58,566.85,561.07,566.4,44.3,89.42,47.54,45.7,44.19,179,148.98,164.99,184.26,180.04,8,36.25,8.45,5.91,6.09 62 | 1960,63.1,63.22,63.39,62.75,66.15,193.9,191.69,194.9,195.49,194.6,559,441.84,559.31,561.45,567.66,53.7,86.38,47.06,45.3,43.85,177.9,147,163.53,180.56,180.74,7.5,34.14,8.17,5.73,5.9 63 | 1961,60.6,62.42,62.56,61.99,65.56,193.4,192.54,195.41,196.04,195.1,545.3,442.1,551.77,561.86,568.92,43.4,83.34,46.58,44.89,43.51,173.1,145.02,162.07,176.87,177.04,6.8,32.04,7.89,5.55,5.72 64 | 1962,62.9,61.62,61.73,61.23,64.97,193.3,193.39,195.92,196.59,195.6,556.9,442.36,544.23,562.25,560.66,47.1,80.3,46.11,44.48,43.17,174,143.04,160.61,173.18,173.34,6.4,29.94,7.61,5.38,5.53 65 | 1963,64,60.82,60.9,60.47,64.38,194.7,194.23,196.42,197.14,196.1,563.4,442.62,536.7,553.92,552.4,55.6,77.26,45.63,44.08,42.83,173.9,141.06,159.14,169.49,169.64,6.2,27.84,7.33,5.2,5.35 66 | 1964,64.1,60.01,60.07,59.71,63.8,193.6,195.08,196.93,197.7,196.6,543.3,442.88,529.16,545.59,544.13,45.4,74.22,45.15,43.67,42.49,167,139.08,157.68,165.79,165.94,5.5,25.73,7.04,5.02,5.16 67 | 1965,65.8,59.21,59.24,58.95,63.21,195.6,195.93,197.44,198.25,197.1,542.5,443.14,521.62,537.26,535.87,46.8,71.18,44.68,43.27,42.15,166.4,137.1,156.22,162.1,162.24,5.2,23.63,6.76,4.84,4.98 68 | 1966,67.6,58.41,58.41,58.19,62.62,196.5,196.78,197.95,198.8,197.6,541.2,443.39,514.08,528.94,527.61,47.9,68.14,44.2,42.86,41.81,165.8,135.12,154.77,158.41,158.54,4.9,21.53,6.48,4.67,4.8 69 | 1967,66.2,57.61,57.58,57.43,62.03,197.3,197.63,198.45,199.35,198.1,524.7,443.65,506.54,520.61,519.34,42.2,65.1,43.72,42.46,41.47,159.3,133.14,153.29,154.71,154.84,4.4,19.43,6.2,4.49,4.61 70 | 1968,65.5,56.8,56.75,56.67,60.95,198.8,198.48,198.96,199.91,198.6,531,443.91,499,512.28,511.08,52.8,62.06,43.25,42.05,41.13,162.5,131.16,149.67,151.02,151.14,3.9,17.32,5.92,4.31,4.43 71 | 1969,64.9,56,55.92,55.9,59.84,198.5,199.33,199.47,200.46,199.1,516.8,444.17,491.46,503.95,502.82,47.9,59.03,42.77,41.64,40.79,155.4,129.18,146.04,147.33,147.44,3.4,15.22,5.64,4.13,4.24 72 | 1970,62.2,55.2,55.09,55.14,58.75,198.6,200.17,199.98,201.01,199.69,492.7,444.43,483.92,495.62,494.56,41.7,55.99,42.29,41.24,40.45,147.4,127.2,142.42,143.63,143.74,3.2,13.12,5.36,3.96,4.06 73 | 1971,60.3,54.4,54.26,54.38,57.65,199.3,201.02,200.48,201.56,200.09,492.9,444.69,476.38,487.29,486.29,38.4,52.95,41.82,40.83,40.11,147.6,125.23,138.79,139.94,140.04,2.7,11.02,5.08,3.78,3.88 74 | 1972,60.2,53.59,53.43,53.62,56.56,200.3,201.87,200.99,202.12,200.59,490.2,444.95,468.85,478.96,478.03,41.3,49.91,41.34,40.43,39.77,147.3,123.25,135.17,136.25,136.34,2.6,8.91,4.8,3.6,3.69 75 | 1973,59.3,52.79,52.6,52.86,55.47,200,202.72,201.5,202.67,201.09,482,445.21,461.31,470.63,469.77,41.2,46.87,40.86,40.02,39.43,145.2,121.27,131.54,132.56,132.64,2.2,6.81,4.52,3.43,3.51 76 | 1974,52.7,51.99,51.77,52.1,54.37,201.5,203.57,202.1,203.22,201.59,458.8,445.47,453.77,462.3,461.5,35.5,43.83,40.38,39.62,39.09,136.8,119.29,127.92,128.86,128.94,2,4.71,4.24,3.25,3.32 77 | 1975,50.8,51.19,50.94,51.34,53.28,200.1,204.42,202.51,203.77,202.09,431.2,445.73,446.23,453.97,453.24,34.9,40.79,39.91,39.21,38.75,123.5,117.31,124.29,125.17,125.24,1.9,2.61,3.96,3.07,3.14 78 | 1976,48.7,50.38,50.11,50.58,52.19,202.5,205.27,203.02,204.32,202.59,426.9,445.99,438.69,445.64,444.98,38.8,37.75,39.43,38.81,38.42,117.4,115.33,120.67,121.48,121.54,1.7,0.5,3.68,2.89,2.95 79 | 1977,48.8,49.58,49.28,49.82,51.09,203.5,206.11,203.53,204.88,203.51,413.7,446.25,431.15,437.31,436.72,31,34.71,38.95,38.4,38.08,110.4,113.35,117.04,117.78,117.84,1.6,-1.6,3.4,2.72,2.77 80 | 1978,48.9,48.78,48.45,49.06,50,204.9,206.96,204.03,205.43,204.42,409.9,446.51,423.61,428.98,428.45,34.5,31.67,38.48,37.99,37.74,103.7,113.37,113.42,114.09,114.14,1.5,-3.7,3.12,2.54,2.59 81 | 1979,46.5,47.98,47.62,48.29,48.91,204,207.81,204.54,205.98,205.34,401.6,446.77,416.07,420.66,420.19,26.1,28.63,38,37.59,37.4,97.3,109.39,109.79,110.4,110.44,1,-5.81,2.84,2.36,2.4 82 | 1980,46.4,47.17,46.79,47.53,47.82,207.9,208.66,205.05,206.53,206.25,412.1,447.03,408.53,412.33,411.93,31.4,25.59,37.52,37.18,37.06,96.4,107.41,106.17,106.7,106.74,1,-7.91,2.55,2.18,2.22 83 | 1981,43.4,46.37,45.95,46.77,46.72,206.4,209.51,205.56,207.09,207.17,397,447.29,401,404,403.66,30,22.55,37.05,36.78,36.72,89.7,105.43,102.54,103.01,103.04,1,-10.01,2.27,2.01,2.03 84 | 1982,40.1,45.57,45.12,46.01,45.63,208.3,210.36,206.06,207.64,208.08,389,447.55,393.46,395.67,395.4,26.5,19.52,36.57,36.37,36.38,84.4,103.45,98.92,99.32,99.34,0.9,-12.11,1.99,1.83,1.85 85 | 1983,39.1,44.77,44.29,45.25,44.54,209.1,211.21,206.57,208.19,209,388.9,447.81,385.92,387.34,387.14,29.8,16.48,36.09,35.97,36.04,81.4,101.47,95.29,95.62,95.64,0.9,-14.22,1.71,1.65,1.67 86 | 1984,38.8,43.96,43.46,44.49,43.44,210.8,212.05,207.08,208.74,209.92,378.8,448.07,378.38,379.01,378.87,30.6,13.44,35.62,35.56,35.7,78.9,99.49,91.67,91.93,91.94,0.8,-16.32,1.43,1.48,1.48 87 | 1985,38.5,43.16,42.63,43.73,42.35,211.3,212.9,207.59,209.3,210.83,375,448.33,370.84,370.68,370.61,34.5,10.4,35.14,35.15,35.36,76.6,97.51,88.04,88.24,88.24,0.8,-18.42,1.15,1.3,1.3 88 | 1986,38.6,42.36,41.8,42.97,41.26,211.5,213.75,208.09,209.85,211.75,365.1,448.59,363.3,362.36,362.35,34.8,7.36,34.66,34.75,35.02,73.3,95.53,84.42,84.55,84.54,0.8,-20.52,0.87,1.12,1.11 89 | 1987,38.2,41.56,40.97,42.21,40.16,211.7,214.6,208.6,210.4,212.66,355.9,448.85,355.76,354.02,354.09,33.8,4.32,34.19,34.34,34.68,71.8,93.55,80.79,80.85,80.84,0.8,-22.63,0.59,0.94,0.93 90 | 1988,38.9,40.75,40.14,41.45,39.07,212.5,215.45,209.11,210.95,213.58,352.5,449.11,348.22,345.69,345.82,37.3,1.28,33.71,33.94,34.34,70.8,91.57,77.17,77.17,77.14,0.8,-24.73,0.31,0.77,0.74 91 | 1989,37.7,39.95,39.31,40.69,37.98,214.2,216.3,209.62,211.5,214.49,332,449.37,340.69,337.36,337.56,35.9,-1.76,33.23,33.53,34,67.1,89.59,73.54,73.47,73.45,0.9,-26.83,0.03,0.59,0.56 92 | 1990,36.2,39.15,38.48,39.92,36.88,216,217.15,210.12,212.06,215.41,321.8,449.63,333.15,329.03,329.3,36.8,-4.8,32.76,33.13,33.66,65.5,87.61,69.92,69.77,69.75,0.8,-28.93,-0.25,0.41,0.38 93 | 1991,34.7,38.35,37.65,39.16,35.79,215.2,217.99,210.63,212.61,216.33,313.8,449.89,325.61,320.7,321.03,34.9,-7.84,32.28,32.72,33.32,63.1,85.63,66.29,66.08,66.05,0.7,-31.04,-0.53,0.23,0.19 94 | 1992,33.2,37.54,36.82,38.4,34.7,213.5,218.84,211.14,213.16,214.31,306.1,450.15,318.07,312.38,312.77,33.1,-10.88,31.8,32.32,32.98,61.6,83.65,62.67,62.39,62.35,0.7,-33.14,-0.81,0.06,0.01 95 | 1993,34.2,36.74,35.99,37.64,33.6,213.5,219.69,211.65,213.71,212.28,309.9,450.4,310.53,304.05,304.51,35.2,-13.92,31.33,31.91,32.64,62.9,81.67,59.04,58.69,58.65,0.7,-35.24,-1.09,-0.12,-0.18 96 | 1994,34.2,35.94,35.16,36.88,32.51,211.7,220.54,212.15,211.23,210.26,299.7,450.66,302.99,295.72,296.25,33.9,-16.95,30.85,31.5,32.3,62.8,79.69,55.42,55,54.95,0.6,-37.34,-1.37,-0.3,-0.36 97 | 1995,34.4,35.14,34.33,36.12,31.42,209.8,221.39,212.66,208.74,208.24,296.3,450.92,295.45,287.39,287.98,33.8,-19.99,30.37,31.1,31.96,63.3,77.71,51.79,51.31,51.25,0.6,-39.45,-1.65,-0.48,-0.54 98 | 1996,34.5,34.33,33.5,35.36,30.32,206.7,222.24,213.17,206.25,206.22,288.3,451.18,287.91,279.06,279.72,33.2,-23.03,29.9,30.69,31.62,62.6,75.73,48.17,47.62,47.55,0.5,-41.55,-1.94,-0.65,-0.73 99 | 1997,34.2,33.53,32.67,34.6,29.23,203.5,223.09,213.68,203.76,204.2,280.4,451.44,280.37,270.73,271.46,33.6,-26.07,29.42,30.29,31.29,61.2,73.75,44.54,43.92,43.85,0.4,-43.65,-2.22,-0.83,-0.91 100 | 1998,34.5,32.73,31.84,33.84,28.14,200.7,223.93,214.18,201.28,202.18,272.4,451.7,272.8,262.4,263.19,34.6,-29.11,28.94,29.88,30.95,59.4,71.11,40.92,40.23,40.15,0.4,-45.75,-2.5,-1.01,-1.1 101 | --------------------------------------------------------------------------------