summary.clv.data: Summarizing a CLV data object

View source: R/f_s3generics_clvdata.R

summary.clv.dataR Documentation

Summarizing a CLV data object

Description

Summary method for objects of class clv.data that provides information about the estimation and possible holdout sample, and descriptive statistics of the transaction data.

Usage

## S3 method for class 'clv.data'
summary(object, Id = NULL, ...)

## S3 method for class 'summary.clv.data'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

## S3 method for class 'clv.data.dynamic.covariates'
summary(object, ...)

## S3 method for class 'summary.clv.data.dynamic.covariates'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

## S3 method for class 'clv.data.static.covariates'
summary(object, ...)

## S3 method for class 'summary.clv.data.static.covariates'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

Arguments

object

A CLV data object containing transactional data and potentially also contextual factors.

Id

A character vector of customer ids for which the transaction data is summarized. Defaults to NULL for all customers.

...

Ignored

x

An object of class "summary.clv.data", usually, a result of a call to summary.clv.data.

digits

The number of significant digits to use when printing.

Details

If applicable, the summary statistics are provided separately for the estimation and holdout period as well as for the overall time period (estimation + holdout). By using the Id argument, the summary statistics can be limited to a subset of customers.

Number of customers

Count of individual customers.

First Transaction in period

Time point of the first transaction occurring in the indicated period.

Last Transaction in period

Time point of the last transaction occurring in the indicated period.

Total # Transactions

Count of transactions occurring in the indicated period.

Mean # Transactions per cust

Average transactions per customer in the indicated period, including standard deviation (SD).

Mean Spending per Transaction

Average spending per customer in the indicated period, including standard deviation (SD). Spending statistics are only available if spending data was provided when creating the object.

Total Spending

Sum of customer spending during the indicated period.

Total # zero repeaters

Number of customers who purchased only once during the estimation period.

Percentage of zero repeaters

Percentage of customers who purchased only once during the estimation period.

Mean Interpurchase time

Average time (in number of periods) between two transactions of the same customer, including standard deviation (SD).

Value

This function computes and returns summary statistics of the transactional and covariates data given in object. This is a list of class summary.clv.data and contains the elements:

name

Human readable description of the type of data.

summary.clv.time

Summary information about the stored clv.time object.

descriptives.transactions

A data.table with summary statistics of the transactions overall and in the estimation and holdout sample.

selected.ids

Ids for which the transaction data was summarized. NULL if all Ids were used.

For static covariates data, the list additionally is of class summary.clv.data.static.covariates and further contains the elements:

names.cov.data.trans

Names of the covariates for the Transaction process.

names.cov.data.life

Names of the covariates for the Lifetime process.

See Also

plot for how to plot a clv data object

clvdata for how to create a clv data object

SetStaticCovariates for how to add static covariates

SetDynamicCovariates for how to add dynamic covariates

Examples




data("apparelTrans")
clv.data.apparel <- clvdata(apparelTrans, date.format = "ymd",
                            time.unit = "w",
                            estimation.split = 40)

# summary of transaction data and split
summary(clv.data.apparel)

# transaction summary of customer "1219"
summary(clv.data.apparel, Id="1219")

# transaction summary of customers "1", "10", "100", and "1000"
summary(clv.data.apparel, Id=c("1", "10", "100", "1000"))

# add contextual factors
data("apparelStaticCov")
clv.data.apparel.cov <-
 SetStaticCovariates(clv.data.apparel,
                     data.cov.life = apparelStaticCov,
                     names.cov.life = "Gender",
                     data.cov.trans = apparelStaticCov,
                     names.cov.trans = "Gender")

# additional info about the covariates
summary(clv.data.apparel.cov)



bachmannpatrick/CLVTools documentation built on Oct. 29, 2023, 2:16 p.m.