Commit f4679a85 authored by Kevin's avatar Kevin

fixed post processing issue

parent 9723914a
...@@ -12,7 +12,7 @@ df_gose <- readRDS(gosefile) ...@@ -12,7 +12,7 @@ df_gose <- readRDS(gosefile)
posteriors <- list.files(modelimputations_dir, pattern = "*.rds") posteriors <- list.files(modelimputations_dir, pattern = "*.rds")
# load and combine all posteriros over different (baseline) imputations # load and combine all posteriors over different (baseline) imputations
df_imputations <- c() df_imputations <- c()
for (i in 1:length(posteriors)) { for (i in 1:length(posteriors)) {
df_imputations <- rbind( df_imputations <- rbind(
...@@ -40,11 +40,12 @@ df_imputations <- df_imputations %>% ...@@ -40,11 +40,12 @@ df_imputations <- df_imputations %>%
{ {
if (length(.) == 0) { # fix all probs. NA case if (length(.) == 0) { # fix all probs. NA case
return(NA) return(NA)
} else {
return(.)
} }
if (length(.) > 1) { # need to resolve ambiguous gose predictions !
return(sample(., 1))
}
return(.)
} %>% } %>%
sample(1) %>% # need to resolve ambiguous gose predictions !
rep(n()), rep(n()),
GOSE = factor( GOSE = factor(
GOSE, GOSE,
......
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