lifedata {bayesmlogit} | R Documentation |
Simplified Data for generating life tables.
Description
Data extracted and processed from The Health and Retirement Study (HRS).
Usage
lifedata
Format
A data frame with 8198 rows and 16 variables:
- trans
Transitions that recorded in the original data. In this data, we have 6 kinds of transtions in total.
- age
Age for each subject.
- male
Sex for each subject. male=1, female=0.
- black,hispanic
Dummy variables for race.
- mar
Marital status.
- educc,educg
Dummy variables for education level.
- cohort
Birth cohort, which is birth year minus 1900.
- neb,mwb,wb
Dummy variables for birth regions.
- nen,mwn,wn
Dummy variables for residential regions.
Details
To use this package with your data, please make sure your data have a vector for transitions. The transitions can be manually created following the example below:
In lifedata
, Each subject has 3 states in the cohort: 1: health; 2: unhealthiness; 3: death.
Thus we will have 6 kind of possible transitions: 1:health to health; 2:health to unhealthiness; 3: health to death; 4: unhealthiness to health; 5: unhealthiness to unhealthiness; 6: unhealthiness to death. To check the transition for each subject, please use lifedata[,1]
.
When creating transitions by yourself, please follow the orders as below:
Health | Unhealthiness | Death | |
Health | 1 | 2 | 3 |
Unhealthiness | 4 | 5 | 6 |
Death | - | - | - |
where the first column indicates the previous state of subjects and the first row indicates the current state that subjects are in. The numbers indicates the index of our transitions.
For impossible transitions like death to death, you can also label them following the above order, which won't change the results. If transitions are not created in this order, the computation may encounter an error. One can also use CreateTrans()
to create the transition vector.