Commit 90809689 authored by Kevin's avatar Kevin

now we have it ....

parent f52fbc4b
......@@ -21,7 +21,8 @@ df_gose <- readRDS(inputfile) %>%
) %>% select(
gupi,
Outcomes.DerivedCompositeGOSE,
Outcomes.DerivedCompositeGOSEDaysPostInjury
Outcomes.DerivedCompositeGOSEDaysPostInjury,
Subject.Age
) %>%
arrange(
gupi,
......@@ -30,11 +31,12 @@ df_gose <- readRDS(inputfile) %>%
# translate to msm formatting
tmp <- df_gose %>%
rbind(tibble( # only predict GOSE at 180 days - takes too long otherwise
gupi = df_gose$gupi %>% unique,
group_by(gupi) %>%
summarize_all(first) %>%
mutate(
Outcomes.DerivedCompositeGOSEDaysPostInjury = config$t_out_msm + .5, # needed to offset
Outcomes.DerivedCompositeGOSE = 99
)) %>%
) %>%
arrange(gupi, Outcomes.DerivedCompositeGOSEDaysPostInjury) %>%
mutate(
obstype = ifelse(Outcomes.DerivedCompositeGOSE == 1, 3, 1), # make death exactly observed transition
......@@ -69,11 +71,11 @@ fit <- msm(
subject = tmp$gupi,
data = tmp,
obstype = tmp$obstype,
covariates = ~ age,
gen.inits = TRUE,
qmatrix = Q,
censor = 99,
pci = c(90, 270),
covariates = ~ Subject.Age,
censor.states = 1:7,
control = list(
fnscale = config$fnscale_msm,
......
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