Description Usage Arguments Value
View source: R/calc_spending_by_month.R
calc_spend_by_month() is a function that calculates both the total/OOP spending by calendar month, and cumulative amounts for each within a year.
1 | calc_spending_by_month(DT, DT_id)
|
DT |
data.table with the columns bene_id, year (relative to enrollment year, starting at 1), month, cost, and oop_cost |
DT_id |
data.table with the column bene_id |
data.table with 7 columns:
bene_id |
|
year |
|
month |
|
cost |
Total spending in month |
cum_cost |
Total spending though month in year |
oop_cost |
OOP spending in month |
cum_oop_cost |
Total OOP spending through month in year |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.