You are previewing Event History Analysis with R.
O'Reilly logo
Event History Analysis with R

Book Description

With an emphasis on social science applications, Event History Analysis with R presents an introduction to survival and event history analysis using real-life examples. Keeping mathematical details to a minimum, the book covers key topics, including both discrete and continuous time data, parametric proportional hazards, and accelerated failure times.

Features

  • Introduces parametric proportional hazards models with baseline distributions like the Weibull, Gompertz, Lognormal, and Piecewise constant hazard distributions, in addition to traditional Cox regression
  • Presents mathematical details as well as technical material in an appendix
  • Includes real examples with applications in demography, econometrics, and epidemiology
  • Provides a dedicated R package, eha, containing special treatments, including making cuts in the Lexis diagram, creating communal covariates, and creating period statistics

A much-needed primer, Event History Analysis with R is a didactically excellent resource for students and practitioners of applied event history and survival analysis.

Table of Contents

  1. Preliminaries
  2. Preface
  3. Chapter 1 Event History and Survival Data
    1. 1.1 Introduction
    2. 1.2 Survival Data
    3. 1.3 Right Censoring
    4. 1.4 Left Truncation
    5. 1.5 Time Scales
      1. 1.5.1 The Lexis Diagram
    6. 1.6 Event History Data
    7. 1.7 More Data Sets
      1. Figure 1.1
      2. Figure 1.2
      3. Figure 1.3
      4. Figure 1.4
      5. Figure 1.5
  4. Chapter 2 Single Sample Data
    1. 2.1 Introduction
    2. 2.2 Continuous Time Model Descriptions
      1. 2.2.1 The Survival Function
      2. 2.2.2 The Density Function
      3. 2.2.3 The Hazard Function
      4. 2.2.4 The cumulative hazard function
    3. 2.3 Discrete Time Models
    4. 2.4 Nonparametric Estimators
      1. 2.4.1 The Hazard Atoms
      2. 2.4.2 The Nelson–Aalen Estimator
      3. 2.4.3 The Kaplan–Meier Estimator.
    5. 2.5 Doing it in R
      1. 2.5.1 Nonparametric Estimation
      2. 2.5.2 Parametric Estimation
      1. Figure 2.1
      2. Figure 2.2
      3. Figure 2.3
      4. Figure 2.4
      5. Figure 2.5
      6. Figure 2.6
      7. Figure 2.7
      8. Figure 2.8
      9. Figure 2.9
      10. Figure 2.10
      11. Figure 2.11
      1. Table 2.1
  5. Chapter 3 Cox Regression
    1. 3.1 Introduction
    2. 3.2 Proportional Hazards
    3. 3.3 The Log-Rank Test
      1. 3.3.1 Two Samples
      2. 3.3.2 Several Samples
    4. 3.4 Proportional Hazards in Continuous Time
      1. 3.4.1 Proportional Hazards, Two Groups
      2. 3.4.2 Proportional Hazards, More Than Two Groups
      3. 3.4.3 The General Proportional Hazards Regression Model
    5. 3.5 Estimation of the Baseline Hazard
    6. 3.6 Explanatory Variables
      1. 3.6.1 Continuous Covariates
      2. 3.6.2 Factor Covariates
    7. 3.7 Interactions
      1. 3.7.1 Two Factors
      2. 3.7.2 One Factor and one Continuous Covariate
      3. 3.7.3 Two Continuous Covariates
    8. 3.8 Interpretation of Parameter Estimates
      1. 3.8.1 Continuous Covariate
      2. 3.8.2 Factor
    9. 3.9 Proportional Hazards in Discrete Time
      1. 3.9.1 Logistic Regression
    10. 3.10 Model Selection
      1. 3.10.1 Model Selection in General
    11. 3.11 Male Mortality
      1. 3.11.1 Likelihood Ratio Test
      2. 3.11.2 The Estimated Baseline Cumulative Hazard Function
      3. 3.11.3 Interaction
      1. Figure 3.1
      2. Figure 3.2
      3. Figure 3.3
      4. Figure 3.4
      5. Figure 3.5
      6. Figure 3.6
      7. Figure 3.7
      8. Figure 3.8
      9. Figure 3.9
      1. Table 3.1
      2. Table 3.2
      3. Table 3.3
      4. Table 3.4
      5. Table 3.5
      6. Table 3.6
  6. Chapter 4 Poisson Regression
    1. 4.1 Introduction
    2. 4.2 The Poisson Distribution
    3. 4.3 The Connection to Cox Regression
    4. 4.4 The Connection to the Piecewise Constant Hazards Model
    5. 4.5 Tabular Lifetime Data
      1. Figure 4.1
      2. Figure 4.2
      3. Figure 4.3
      4. Figure 4.4
      5. Figure 4.5
  7. Chapter 5 More on Cox Regression
    1. 5.1 Introduction
    2. 5.2 Time-Varying Covariates
    3. 5.3 Communal covariates
    4. 5.4 Tied Event Times
    5. 5.5 Stratification
    6. 5.6 Sampling of Risk Sets
    7. 5.7 Residuals
      1. 5.7.1 Martingale Residuals
    8. 5.8 Checking Model Assumptions
      1. 5.8.1 Proportionality
      2. 5.8.2 Log-Linearity
    9. 5.9 Fixed Study Period Survival
    10. 5.10 Left- or Right-Censored Data
      1. Figure 5.1
      2. Figure 5.2
      3. Figure 5.3
      4. Figure 5.4
      5. Figure 5.5
      6. Figure 5.6
      7. Figure 5.7
      8. Figure 5.8
      9. Figure 5.9
      10. Figure 5.10
      11. Figure 5.11
      12. Figure 5.12
      1. Table 5.1
      2. Table 5.2
  8. Chapter 6 Parametric Models
    1. 6.1 Introduction
    2. 6.2 Proportional Hazards Models
      1. 6.2.1 The Weibull Model
      2. 6.2.2 The Lognormal Model
      3. 6.2.3 Comparing the Weibull and Lognormal Fits
      4. 6.2.4 The Piecewise Constant Hazards (PCH) Model
        1. 6.2.4.1 Testing the Proportionality Assumption with the PCH Model
      5. 6.2.5 Choosing the best parametric model
    3. 6.3 Accelerated Failure Time Models
      1. 6.3.1 The AFT Regression Model
      2. 6.3.2 Different Parametrizations
      3. 6.3.3 AFT Models in R
    4. 6.4 Proportional Hazards or AFT Model?
    5. 6.5 Discrete Time Models
      1. Figure 6.1
      2. Figure 6.2
      3. Figure 6.3
      4. Figure 6.4
      5. Figure 6.5
      6. Figure 6.6
      7. Figure 6.7
      8. Figure 6.8
      9. Figure 6.9
      10. Figure 6.10
      11. Figure 6.11
      12. Figure 6.12
      13. Figure 6.13
      14. Figure 6.14
      15. Figure 6.15
      16. Figure 6.16
      17. Figure 6.17
      18. Figure 6.18
      19. Figure 6.19
      20. Figure 6.20
  9. Chapter 7 Multivariate Survival Models
    1. 7.1 Introduction
      1. 7.1.1 An Introductory Example
    2. 7.2 Frailty Models
      1. 7.2.1 The Simple Frailty Model
      2. 7.2.2 The Shared Frailty Model
    3. 7.3 Parametric Frailty Models
    4. 7.4 Stratification
      1. Figure 7.1
  10. Chapter 8 Competing Risks Models
    1. 8.1 Introduction
    2. 8.2 Some Mathematics
    3. 8.3 Estimation
    4. 8.4 Meaningful Probabilities
    5. 8.5 Regression
    6. 8.6 R Code for Competing Risks
      1. Figure 8.1
      2. Figure 8.2
      3. Figure 8.3
      1. Table 8.1
  11. Chapter 9 Causality and Matching
    1. 9.1 Introduction
    2. 9.2 Philosophical Aspects of Causality
    3. 9.3 Causal Inference
      1. 9.3.1 Graphical Models
      2. 9.3.2 Predictive causality
      3. 9.3.3 Counterfactuals
    4. 9.4 Aalen’s Additive Hazards Model
    5. 9.5 Dynamic Path Analysis
    6. 9.6 Matching
      1. 9.6.1 Paired Data
      2. 9.6.2 More than One Control
    7. 9.7 Conclusion
      1. Figure 9.1
      2. Figure 9.2
      3. Figure 9.3
  12. Appendix A Basic Statistical Concepts
    1. A.1 Introduction
    2. A.2 Statistical Inference
      1. A.2.1 Point Estimation
      2. A.2.2 Interval Estimation
      3. A.2.3 Hypothesis Testing
        1. A.2.3.1 The Log-Rank Test
    3. A.3 Asymptotic theory
      1. A.3.1 Partial likelihood
    4. A.4 Model Selection
      1. A.4.1 Nested Models
      1. Table A.1
  13. Appendix B Survival Distributions
    1. B.1 Introduction
    2. B.2 Relevant Distributions in R
      1. B.2.1 The Exponential Distribution
      2. B.2.2 The Piecewise Constant Hazard Distribution
      3. B.2.3 The Weibull Distribution
        1. B.2.3.1 Graphical Test of the Weibull Distribution
      4. B.2.4 The Lognormal Distribution
      5. B.2.5 The Loglogistic Distribution
      6. B.2.6 The Gompertz Distribution
      7. B.2.7 The Gompertz–Makeham Distribution
      8. B.2.8 The Gamma Distribution
    3. B.3 Parametric Proportional Hazards and Accelerated Failure Time Models
      1. B.3.1 Introduction
      2. B.3.2 The Proportional Hazards Model
        1. B.3.2.1 Data and the Likelihood Function
      3. B.3.3 The Shape-Scale Families
        1. B.3.3.1 The Weibull Family of Distributions
        2. B.3.3.2 The EV family of distributions
        3. B.3.3.3 The Gompertz Family of Distributions
        4. B.3.3.4 Other Families of Distributions
      4. B.3.4 The Accelerated Failure Time Model
        1. B.3.4.1 Data and the Likelihood Function
      1. Figure B.1
      2. Figure B.2
      3. Figure B.3
      4. Figure B.4
  14. Appendix C A Brief Introduction to R
    1. C.1 R in General
      1. C.1.1 R Objects
      2. C.1.2 Expressions and Assignments
      3. C.1.3 Objects
      4. C.1.4 Vectors and Matrices
      5. C.1.5 Lists
      6. C.1.6 Data Frames
      7. C.1.7 Factors
      8. C.1.8 Operators
      9. C.1.9 Recycling
      10. C.1.10 Precedence
    2. C.2 Some Standard R Functions
      1. C.2.1 Sequences
      2. C.2.2 Logical expression
      3. C.2.3 Indexing
      4. C.2.4 Vectors and Matrices
      5. C.2.5 Conditional Execution
      6. C.2.6 Loops
      7. C.2.7 Vectorizing
    3. C.3 Writing Functions
      1. C.3.1 Calling Conventions
      2. C.3.2 The Argument “...”
      3. C.3.3 Writing Functions
      4. C.3.4 Lazy Evaluation
      5. C.3.5 Recursion
      6. C.3.6 Vectorized Functions
      7. C.3.7 Scoping Rules
    4. C.4 Graphics
    5. C.5 Probability Functions
      1. C.5.1 Some Useful R Functions
        1. C.5.1.1 Matching
        2. C.5.1.2 General utility functions
    6. C.6 Help in R
    7. C.7 Functions in eha and survival
      1. C.7.1 Checking the Integrity of Survival Data
    8. C.8 Reading Data into R
      1. C.8.1 Reading Data from ASCII Files
      2. C.8.2 Reading Foreign Data Files
      1. Figure C.1
      2. Figure C.2
      1. Table C.1
  15. Appendix D Survival Packages in R
    1. D.1 Introduction
    2. D.2 eha
    3. D.3 survival
    4. D.4 Other Packages
      1. D.4.1 coxme
      2. D.4.2 timereg
      3. D.4.3 cmprsk
  16. Bibliography