[R] Cramer von Mises test for a discrete distribution

Santiago Guallar sguallar at yahoo.com
Tue Feb 19 15:49:45 CET 2013


Hi,
 
I'm trying to carry out Cramer von Mises tests between pairs of vectors belonging to a discrete distribution (concretely frequencies from 0 to 200). However, the program crashes in the attempt. The problem seems to be that these vectors only have positive integer numbers (+ zero). When I add a random very small positive decimal to the non-decimal part everything works fine (files prm1 & prpmr1). I attach two of these vectors so you can run the following code. I've also thought to divide both vectors by a real constant such as pi. Do you think these two approaches are acceptable?
 
setwd("")
require(CvM2SL2Test)
prm = scan('prm.txt')
prpmr = scan('prpmr.txt')
ct1 = cvmts.test(prm, prpmr) # here R crashes
ct1
cvmts.pval( ct1, length(prm), length(prpmr) )
 
 
Thank you for your help,
 
Santi
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prm.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130219/a543b86c/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prpmr.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130219/a543b86c/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prm1.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130219/a543b86c/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prpmr1.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130219/a543b86c/attachment-0003.txt>


More information about the R-help mailing list