Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GOSe-6mo-imputation-paper
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Kevin Kunzmann
GOSe-6mo-imputation-paper
Commits
90809689
Commit
90809689
authored
Feb 08, 2019
by
Kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now we have it ....
parent
f52fbc4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
models/msm_age/fit.R
models/msm_age/fit.R
+7
-5
No files found.
models/msm_age/fit.R
View file @
90809689
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment