Hi,
I'm using Rpy2's rpy_classic like this (too lazy to learn rpy2 at the
moment, and also for backward compatiblity):
import rpy2.rpy_classic as rpy
rpy.set_default_mode(rpy.NO_CONVERSION)
rpy.set_default_mode(rpy.BASIC_CONVERSION)
from rpy2.rpy_classic import r
I ran a simple chisq.test and get the p-value:
>>> r.chisq_test(r.array(r.c(30,30,30,40), r.c(2,2)))['p.value']
[0.5110488670165058]
The thing is, it's different from running R directly.
> chisq.test(array(c(30,30,30,40), c(2,2)))
Pearson's Chi-squared test with Yates' continuity correction
data: array(c(30, 30, 30, 40), c(2, 2))
X-squared = 0.407, df = 1, p-value = 0.5235
I double checked the p-value with an online chi square calculator and
R's result should be right instead of rpy's.
I ran both test on the same machine. What am I doing wrong?
Timothy
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list