Created
July 19, 2016 14:21
-
-
Save benwhalley/9b465121fddbd632d0b07d38960f1165 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rf2.longs.with <- bind_sims(extract_sims(rf2.preds), newdata) | |
rf2predswide <- rf2.longs %>% | |
dcast(., month+sim+pd.b~grp, value.var="fitted", fun.aggregate=mean) | |
intervals <- rf2predswide %>% | |
mutate(diff=tau-dbt) %>% | |
group_by(month) %>% | |
do(., as.data.frame(t(quantile(.$diff, probs=c(.025, .5, .975))))) | |
names(intervals) <- c("month", "lo", 'med', "hi") | |
intervals |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment