Open andkov opened 8 years ago
The first modification of models has been estimated : html (more source code) + pdf (less source code):
# transition matrix
Q <- rbind( c(0, q, 0, q),
c(q, 0, q, q),
c(0, 0, 0, q),
c(0, 0, 0, 0))
# misclassification matrix
E <- rbind( c( 0, 0, 0, 0),
c( 0, 0, .1, 0),
c( 0, 0, 0, 0),
c( 0, 0, 0, 0) )
# Forward transitions:
"1-2" = "age + male + educat"
"2-3" = "age + male + educat"
# Backward transitions:
"2-1" = "age"
# Death transitions:
"1-4" = "age + male"
"2-4" = "age + male"
"3-4" = "age + male"
# Forward transitions:
"1-2" = "age + age_bl + male + educat"
"2-3" = "age + age_bl + male + educat"
# Backward transitions:
"2-1" = "age + age_bl"
# Death transitions:
"1-4" = "age + age_bl + male"
"2-4" = "age + age_bl + male"
"3-4" = "age + age_bl + male"
@GracielaMuniz @smhofer
In order to match the tables from Marioni it was decided to transform education into two dummy variables that would encode comparison between education groups.
The new model fitting in msm
call should be modified in the following way:
1-4
, 2-4
, 3-4
) must be adjusted for age
, sex
, and edu_low_med',
edu_low_high` 2-1
) to be adjusted only for age
1-2
, 2-3
) to be adjusted by
age
, sex
, edu_low_med',
edu_low_high,
ses`age
, sex
, edu_low_med',
edu_low_high` The construction of the dummies for education:
# ref D1 D2
# -1 0 0
# 0 1 0
# 1 0 1
D1
= edu_low_med
- the effect of medium education (10, 11 years of edu) vs low education ( less than 10 years of education) D2
= edu_low_high
- the effect of high education ( greater than 11 years of education) vs low education (less than 10 years of education)The second modification of models has been estimated :
# transition matrix
Q <- rbind( c(0, q, 0, q),
c(q, 0, q, q),
c(0, 0, 0, q),
c(0, 0, 0, 0))
# misclassification matrix
E <- rbind( c( 0, 0, 0, 0),
c( 0, 0, .1, 0),
c( 0, 0, 0, 0),
c( 0, 0, 0, 0) )
# Forward transitions:
"1-2" = "age + male + edu_low_med + edu_low_high"
"2-3" = "age + male + edu_low_med + edu_low_high"
# Backward transitions:
"2-1" = "age"
# Death transitions:
"1-4" = "age + male"
"2-4" = "age + male"
"3-4" = "age + male"
# Forward transitions:
"1-2" = "age + male + edu_low_med + edu_low_high"
"2-3" = "age + male + edu_low_med + edu_low_high"
# Backward transitions:
"2-1" = "age"
# Death transitions:
"1-4" = "age + male + edu_low_med + edu_low_high"
"2-4" = "age + male + edu_low_med + edu_low_high"
"3-4" = "age + male + edu_low_med + edu_low_high"
@GracielaMuniz @smhofer @annierobi
Modification 1
During the morning discussion we have identified the following model to be tested. Either model A or B can be modified in this way, however we start with model B.
The
msm
call should be modified in the following way:1-4
,2-4
,3-4
) must be adjusted forage
andsex
2-1
) to be adjusted only forage
1-2
,2-3
) to be adjusted byage
,sex
,education
,ses
age
,sex
,education
The linking of the covariates to the specific transition is implemented in the
covariates
argument of themsm
function: