Commit 2350ad89 authored by Kevin's avatar Kevin

fixed msm-age

parent 90809689
...@@ -31,11 +31,14 @@ df_gose <- readRDS(inputfile) %>% ...@@ -31,11 +31,14 @@ df_gose <- readRDS(inputfile) %>%
# translate to msm formatting # translate to msm formatting
tmp <- df_gose %>% tmp <- df_gose %>%
rbind(
df_gose %>%
group_by(gupi) %>% group_by(gupi) %>%
summarize_all(first) %>% summarize_all(first) %>%
mutate( mutate(
Outcomes.DerivedCompositeGOSEDaysPostInjury = config$t_out_msm + .5, # needed to offset Outcomes.DerivedCompositeGOSEDaysPostInjury = config$t_out_msm + .5, # needed to offset
Outcomes.DerivedCompositeGOSE = 99 Outcomes.DerivedCompositeGOSE = 99
)
) %>% ) %>%
arrange(gupi, Outcomes.DerivedCompositeGOSEDaysPostInjury) %>% arrange(gupi, Outcomes.DerivedCompositeGOSEDaysPostInjury) %>%
mutate( mutate(
...@@ -71,7 +74,7 @@ fit <- msm( ...@@ -71,7 +74,7 @@ fit <- msm(
subject = tmp$gupi, subject = tmp$gupi,
data = tmp, data = tmp,
obstype = tmp$obstype, obstype = tmp$obstype,
covariates = ~ age, covariates = ~ Subject.Age,
gen.inits = TRUE, gen.inits = TRUE,
qmatrix = Q, qmatrix = Q,
censor = 99, censor = 99,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment