rtTimeMatrix | R Documentation |
Generates the array necessary to estimate a repeat transactions model
rtTimeMatrix(rt_df)
rt_df |
object of class 'rtdata': repeat transaction data.frame created by rtCreateTrans() |
matrix to be used on the right hand side of a repeat sales regression model
Time periods are calculated from the data provided.
# Load data
data(ex_sales)
# With a raw transaction data.frame
rt_data <- rtCreateTrans(trans_df = ex_sales,
prop_id = 'pinx',
trans_id = 'sale_id',
price = 'sale_price',
periodicity = 'monthly',
date = 'sale_date')
# Create Matrix
rt_matrix <- rtTimeMatrix(rt_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.