Multistage data preparation

Description

Data preparation utility function for taking into account the number of visits (within the clickstream) of the starting pages.

Usage

1
msprep(linkdata, linkfreq.res, stage.depth = 2, elim = TRUE, sess = TRUE)

Arguments

linkdata

Data frame with session ID, user ID, from, to, dwelltime, covariate

linkfreq.res

Result from linkfreq() analysis

stage.depth

Integer denoting the stage depth

elim

It TRUE it eliminates PI's larger than stage depth, if FALSE, successive PI's go into last stage

sess

If TRUE, analysis is performed at session level, otherwise at user level

Value

Returns a data frame suited for multistage competing risks modeling.

See Also

mscuminc

Examples

1
2
3
4
data(webshop)
webshopsub <- webshop[1:1000,]
freqsub <- linkfreq(webshopsub[,3], webshopsub[,4])
msdata <- msprep(webshopsub, freqsub, stage.depth = 4)