Learn R Programming

BTYDplus (version 0.7.2)

elog2cbs: Convernt Event Log to customer-level summary statistic.

Description

Takes the event log of a customer cohort, and returns a sufficient summary statistic for applying common BTYD models.

Usage

elog2cbs(elog, per = "week", T.cal = max(elog$date),
  T.tot = max(elog$date))

Arguments

elog

Event log, a data.frame with columns cust and transaction time t or date. If column sales is present, it will be aggregated as well.

per

Time unit, either 'week', 'day', 'hour', 'min', 'sec'.

T.cal

End date of calibration period.

T.tot

End date of holdout period.

Value

data.frame with fields

cust

customer id (unique key)

x

number of recurring events in calibration period

t.x

time between first and last event in calibration period

litt

sum of logarithmic intertransaction timings durint calibration period

sales

sum of sales in calibration period

first

date of first transaction in calibration period

T.cal

time between first event and end of calibration period

T.star

length of holdout period

x.star

number of events within holdout period

sales.star

sum of sales within holdout period

Details

Note: compared to dc.ElogToCbsCbt this also adds a summary statistic for estimating regularity.

Customers without any transaction during calibration period are being dropped from the result. Transactions with identical cust and date field are treated as a single transaction, with `sales` being summed up

Examples

Run this code
# NOT RUN {
elog <- cdnow.sample()$elog
cbs <- elog2cbs(elog, T.cal = "1998-01-01", T.tot = "1998-03-31")
head(cbs)
# }

Run the code above in your browser using DataLab