chiSquareTest {clickstream} | R Documentation |
Calculates the chi-square statistic
Description
Calculates the chi-Square statistic, p-value, and degrees of freedom, for the first-order transition matrix of a MarkovChain
object compared with observed state changes.
Usage
chiSquareTest(cls, mc)
Arguments
cls |
The clickstream object. |
mc |
The Markov chain against which to compare the clickstream data. Please note that the first-order transition matrix is used for performing the chi-square test. |
Author(s)
Theo van Kraay theo.vankraay@hotmail.com
Examples
clickstreams <- c("User1,h,c,c,p,c,h,c,p,p,c,p,p,o",
"User2,i,c,i,c,c,c,d",
"User3,h,i,c,i,c,p,c,c,p,c,c,i,d",
"User4,c,c,p,c,d")
csf <- tempfile()
writeLines(clickstreams, csf)
cls <- readClickstreams(csf, header = TRUE)
unlink(csf)
mc <- fitMarkovChain(cls)
chiSquareTest(cls, mc)
[Package clickstream version 1.3.3 Index]