Open osambista opened 1 year ago
ntile() function in code starting on line 278 appears to run, but data, while bucketed into 100 groups, is not ranked and thus doesn't yield results listed in text for Top 1% and Bottom 1% of cases. Solved by ungrouping data prior to use of ntile().
share <- share %>% ungroup() %>% mutate(q100_pred_lpm = ntile(pred_lpm, 100))
ntile() function in code starting on line 278 appears to run, but data, while bucketed into 100 groups, is not ranked and thus doesn't yield results listed in text for Top 1% and Bottom 1% of cases. Solved by ungrouping data prior to use of ntile().
share <- share %>% ungroup() %>% mutate(q100_pred_lpm = ntile(pred_lpm, 100))