calc_spending_by_month: Calculate New Enrollee Part D Spending by Month

Description Usage Arguments Value

View source: R/calc_spending_by_month.R

Description

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.

Usage

1

Arguments

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

Value

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


evanjflack/cfo.behavioral documentation built on Oct. 10, 2020, 11:52 p.m.