Learn R Programming

CLVTools (version 0.8.0)

summary.clv.data: 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 clv.data
summary(object, ...)

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

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

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

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

# S3 method for 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.

...

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.

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.tim

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.

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

Run this code
# NOT RUN {
# }
# NOT RUN {
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)

# 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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab