chiSquareTest | R Documentation |
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.
chiSquareTest(cls, mc)
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. |
Theo van Kraay theo.vankraay@hotmail.com
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.