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
fe733620
Commit
fe733620
authored
Feb 08, 2019
by
Kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed definition of locf
parent
2350ad89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
models/locf/fit.R
models/locf/fit.R
+7
-3
reports/imputations.Rmd
reports/imputations.Rmd
+2
-2
No files found.
models/locf/fit.R
View file @
fe733620
...
...
@@ -18,11 +18,11 @@ df <- readRDS(inputfile) %>%
)
)
impute_locf
<-
function
(
t
,
GOSE
,
t
olerance
,
t
_pred
)
{
impute_locf
<-
function
(
t
,
GOSE
,
t_pred
)
{
res
<-
numeric
(
length
(
t_pred
))
res
[]
<-
NA_integer_
for
(
i
in
1
:
length
(
t_pred
))
{
res
[
i
]
<-
GOSE
[
t
<
t_pred
[
i
]
+
tolerance
]
%>%
res
[
i
]
<-
GOSE
[
t
<
t_pred
[
i
]
&
t
>
76
]
%>%
tail
(
1
)
%>%
# use last if multiple available
ifelse
(
length
(
.
)
==
0
,
NA
,
.
)
}
...
...
@@ -34,7 +34,11 @@ df_posteriors <- df %>%
arrange
(
gupi
,
Outcomes.DerivedCompositeGOSE
)
%>%
do
(
t
=
config
$
t_out
,
GOSE_predicted
=
impute_locf
(
.
$
Outcomes.DerivedCompositeGOSEDaysPostInjury
,
.
$
Outcomes.DerivedCompositeGOSE
%>%
as.character
%>%
as.integer
,
config
$
t_buffer
,
config
$
t_out
)
GOSE_predicted
=
impute_locf
(
.
$
Outcomes.DerivedCompositeGOSEDaysPostInjury
,
.
$
Outcomes.DerivedCompositeGOSE
%>%
as.character
%>%
as.integer
,
config
$
t_out
)
)
%>%
unnest
%>%
mutate
(
...
...
reports/imputations.Rmd
View file @
fe733620
...
...
@@ -41,8 +41,8 @@ imputations.
```{r, fig.height=7, fig.width=7}
caret::confusionMatrix(
df_imputations$Subject.DerivedImputed180DaysGOSE %>% factor,
df_imputations$Subject.GOSE6monthEndpointDerived %>% factor
df_imputations$Subject.DerivedImputed180DaysGOSE %>% factor
(levels = 1:8)
,
df_imputations$Subject.GOSE6monthEndpointDerived %>% factor
(levels = 1:8)
) %>%
as.matrix %>% as_tibble %>%
mutate(
...
...
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