Skip to content

Commit

Permalink
calculate in hospital mortality. fix #20
Browse files Browse the repository at this point in the history
  • Loading branch information
anobel committed Feb 16, 2016
1 parent 1892cde commit baed217
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rao_processing_oshpd.r
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,17 @@ pt$volumequart <- factor(pt$volumequart)

rm(cohort, codes, diags, procs, icd9detail)

# Calculate cohort specific in-hospital mortality over the time period, merge with primary data
pt <- pt %>%
filter(!is.na(cohort)) %>%
group_by(providerid, cohort) %>%
dplyr::summarise(
cohortadmits = n(),
cohortdeaths = sum(disp=="Died")) %>%
mutate(cohortmortality = (cohortdeaths/cohortadmits)*100) %>%
arrange(desc(cohortdeaths)) %>%
right_join(pt)

saveRDS(pt, file="rao_workingdata/pt.rds")

# Once complete, run rao_processing_all.r to combine with other datasets
Expand Down

0 comments on commit baed217

Please sign in to comment.