Usage
dc.ElogToCbsCbt(elog, per = "week", T.cal = max(elog$date), T.tot = max(elog$date), merge.same.date = TRUE, cohort.birth.per = T.cal, dissipate.factor = 1, statistic = "freq")
Arguments
elog
event log, which is a data frame with columns for customer ID ("cust"), date ("date"), and optionally other columns such as "sales". Each row represents an event, such as a transaction. The "date" column must contain date
objects, not character strings or factors.
per
interval of time for customer-by-sufficient-statistic
matrix. May be "day", "week", "month", "quarter", or "year".
T.cal
R date object indicating when the calibration
period ends.
T.tot
R date object indicating when holdout period
ends.
merge.same.date
If TRUE, transactions from the same period
count as a single transaction instead of counting as multiple
transactions.
cohort.birth.per
Time interval used to filter the event
log. Can be specified as a Date object or a vector of two
Dates. If one date object is used, the birth period is from the
minimum date in the dataset through the given date. If two dates
are given, the birth period is set between (inclusive) the two
dates.
dissipate.factor
integer indicating how much of the dataset
to eliminate. If left as 1, none of the dataset is
eliminated. (dissipate.factor-1)/(dissipate.factor) events will
be removed from the event log. For example, if 2 is provided, 1/2
of the event log is eliminated, and if 10 is provided, 9/10 of the
event log is eliminated.
statistic
Determines type of CBT returned: can be: "reach",
"freq", "total.spend", or "average.spend." (note: spend requires
$sales column in elog)