Learn R Programming

ChannelAttribution (version 2.0.7)

transition_matrix: Transition matrix.

Description

Estimate a k-order transition matrix from customer journey data.

Usage

transition_matrix(Data, var_path, var_conv, var_null, order=1, sep=">", 
                  flg_equal=TRUE, flg_adv=TRUE)

Value

An object of class

List containing a dataframe with channel names and a dataframe with the estimated transition matrix.

Arguments

Data

data.frame containing customer journeys data.

var_path

column name containing paths.

var_conv

column name containing total conversions.

var_null

column name containing paths that do not lead to conversions.

order

Markov Model order.

sep

separator between the channels.

flg_equal

if TRUE, transitions from a channel to itself will be considered.

flg_adv

if TRUE, ChannelAttribution Pro banner is printed.

Author

Davide Altomare (info@channelattribution.io).

Examples

Run this code

if (FALSE) {

library(ChannelAttribution)

data(PathData) 

transition_matrix(Data, var_path="path", var_conv="total_conversions",
                  var_null="total_null", order=1, sep=">", flg_equal=TRUE)

transition_matrix(Data, var_path="path", var_conv="total_conversions",
                  var_null="total_null", order=3, sep=">", flg_equal=TRUE)

}

Run the code above in your browser using DataLab