The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Data structure for a discrete-time event history analysis Jane E. Miller, PhD
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Overview Structure of most survey data: One record per respondent Discrete-time event history analysis requires separate records for each person-time unit at risk of the event Review: How to create one record per spell How to create one record per person-time unit – Components of the dependent variable – Fixed characteristics – Time varying characteristics The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition.
Event history analysis: discrete time data Data preparation for an event history Survey data often contains one record per respondent Continuous-time event history data contain one record per spell Discrete-time event history analysis requires one record per person-time unit within each spell – E.g., one record for each person-month at risk of divorce, within each spell at risk of divorce
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Source data from survey: 1 record per respondent ID Date of birth Date of 1st marriage Date of 1st divorce Date of 2nd marriage Date of 2nd divorce Date of death Date 1st observed Date last observedGender Date of 1st child's birth Date of 2nd child's birth 12/1/ /15/8510/1/10F.. 27/15/696/22/ /21/8511/5/10M.. 33/1/658/1/901/1/9710/1/04..10/8/855/1/05M12/5/95. 43/1/426/1/ /1/0212/2/8510/2/02F9/21/645/11/67
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Example timelines for study of divorce End of observation period L M = Married D = Divorced L = Lost to follow-up O = Censored by end of study. X = Died D M M M O X M Case 1: Never married -> no spells Case 2: Married once, censored by end of survey Case 3: Married twice, lost to follow-up before end of survey Case 4: Married once, died before end of survey Not married -> not at risk of divorce -> not part of a spell
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Continuous-time event history data One record for each period at risk (spell) – Duration of overall spell – Event indicator at end of spell ID Spell # (marriage #) Date spell started Duration of spell (mos.) Status at end of spell Divorce event indicator Age first observed (yrs) Age at start of spell (yrs) Age last observed (yrs)Gender # kids at start of spell 216/22/ male0 318/1/ male0 3210/1/ male1 416/1/ female0
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Event history timeline: Discrete time specification Case 2, Continuous time version: One four-month spell Married 6/22/2010Last surveyed 11/5/ st person-month Four person-month units Case 2, Discrete-time version: Each person-month unit becomes one record -> unit of analysis. All records for each spell include respondent ID and other characteristics. Married O 2 nd person-month OO 3 rd person-month OO 4 th person-month O End of survey O = Censored
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data One record per person-month ID Spell # (marriage #) Record # w/in spell … … 327 One record per spell ID Spell # (marriage #) Duration of spell (mos.) Status at end of spell Divorce indicator Discrete-time data set: ID codes on person-time records Each person-month record carries the respondent ID Each record within a given spell also includes the spell # for that respondent
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Record number within spell Each month in a spell will generate one person-month record, e.g., – respondent #2 is observed for 4 months -> 4 person-month records – respondent #3 contributes a total of 84 records 77 in his first spell 7 in his second spell One record per person-month ID Spell # (marriage #) Record # w/in spell … … 327 One record per spell ID Spell # (marriage #) Duration of spell (mos.) Status at end of spell Divorce indicator
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Month counter within spell One record per person-month ID Spell # (marriage #) Record # w/in spell month # within spell …… …… 3276 One record per spell ID Spell # (marriage #) Duration of spell (mos.) Status at end of spell Divorce indicator The “month # within spell” counter indicates the start time of the person-month at risk for that record. E.g., the first record for a given spell starts at baseline (time point 0).
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Duration measure for each record within spell The duration measure will = 1 time units for all person-time records within a given spell EXCEPT = 0.5 for the last month in a spell One record per person-month ID Spell # (marriage #) Record # w/in spell month # within spell Person- months w/in record …… …… One record per spell ID Spell # (marriage #) Duration of spell (mos.) Status at end of spell Divorce indicator
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Status indicator for each record within spell The indicator for status at end of record will = 0 for all person-time records within a given spell EXCEPT the last one because by definition they end in censoring (the spell is not yet complete) One record per person-month ID Spell # (marriage #) Record # w/in spell month # within spell Person- months w/in record Status at end of record …… …… One record per spell ID Spell # (marriage #) Duration of spell (mos.) Status at end of spell Divorce indicator
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Status indicator for last record within spell The indicator for status at end of record for the last person- time record within each spell will take on the value of the status indicator for the overall spell One record per person-month ID Spell # (marriage #) Record # w/in spell month # within spell Person- months w/in record Status at end of record …… …… One record per spell ID Spell # (marriage #) Duration of spell (mos.) Status at end of spell Divorce indicator
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Event indicator for each record within spell One record per person-month ID Spell # (marriage #) Record # w/in spell month # within spell Divorce indicator for record …… …… One record per spell ID Spell # (marriage #) Duration of spell (mos.) Status at end of spell Divorce indicator
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Fixed covariates for each person-time record ID Spell # (marriage #) Record # w/in spell month # within spell Divorce indicator for record Age at start of spell (yrs)Gender # children at start of spell male male male male male male male0 31……025male male male male1 32……039male male1 Age, number of children at start of spell, and gender do not change during the course of a spell, so they have the same value for each person-time record within a given spell
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Example timelines for number of children as time-varying covariate in study of divorce L M = Married D = Divorced C = Child born L = Lost to follow-up O = Censored by end of study. X = Died D M M X M Case 3: Case 4: C CC No kids One kid Two kids One kid ID Date of birth Date 1st observed Date of 1st marriage Date of 1st child's birth Date of 2nd child's birth Date of 1st divorce Date of 2nd marriage Date of 2nd divorce Date of death Date last observed 33/1/6510/8/858/1/9012/5/95.1/1/9710/1/04..5/1/05 43/1/4212/2/856/1/639/21/645/11/ /1/0210/2/02 Columns reordered into chronological order
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Discrete time with time-varying covariates Case 3 has his first child 64 months into his first marriage, and no additional children while observed. # kids at start of record is 0 for his first 63 records of spell 1 1 for records 64 through 77 of spell 1 1 for all records in spell 2 IDSpell # month # w/in spell Divorce indicator for record # kids at start of spell # kids at start of record … …
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Discrete time with time-varying covariates Case 4 has her first child 15 months into her marriage, a second child in month 47 after marriage. For her the # kids at start of record is 0 for her first 15 records 1 for records 15 through 46 2 for records 47 or higher, all in spell 1 IDSpell # month # w/in spell Divorce indicator for record # kids at start of spell # kids at start of record … … …
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Presenting information on event history construction: Background work Most of the gory details of creating an event history are part of behind-the-scenes work – Important to do consistency checks to make sure event histories were created correctly given Original data source of information for timeline construction Type of event under study Fixed covariates Time-varying covariates – E.g., correct Number of spells per respondent Number of person-time records for each spell Duration and event indicators for each person-time record Values of fixed- and time-varying covariates for each person-time record
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Presenting information on event history construction In the data and methods section, describe: – Original data source of information for timeline construction Dates, status, duration of events – Type of event under study – Unit of person-time (e.g., person-years, person-months) – What constitutes censoring – Fixed covariates – Time-varying covariates Source(s) of information for determining timing of changes in those variables See checklist in chapter 17 of Writing about Multivariate Analysis, 2nd Edition for more detail on what to report
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Summary A discrete-time event history analysis requires a separate record for each person-time unit at risk of the event For each respondent, create correct number of spells For each spell, calculate – Correct number of person-time units – Components of the dependent variable Duration measure Event indicator – Fixed characteristics – Time-varying characteristics In data and methods section, describe data sources and variables for the event history The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition.
Event history analysis: discrete time data Suggested resources Allison, P. D Survival Analysis Using the SAS System: A Practical Guide, 2nd Edition. Cary, NC: SAS Institute. Miller, J. E The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. University of Chicago Press, chapter 17. The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition.
Event history analysis: discrete time data Suggested online resources Podcast on data structure for a continuous- time event history analysis
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Suggested exercises Study guide to The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. – Question #3a in the problem set for chapter 17 – Suggested course extensions for chapter 17 “Reviewing” exercises #2a through 2h “Applying statistics and writing” exercises #1 and 2a
The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition. Event history analysis: discrete time data Contact information Jane E. Miller, PhD Online materials available at The Chicago Guide to Writing about Multivariate Analysis, 2nd Edition.