Re: [Rpy] chisq problem

2007-09-21 Thread Eloi Ribeiro
Hi Matthew, No, this 32-bit system. More details: * Processor Intel 32-bit * Win 2000, 5.00.2195, Service Pack 4 * R2.5 & R2.4.1 (though we're using R2.4.1 for the tests) * Numeric-24.2.win32-py2.4 * rpy-1.0-RC2.win32-R2.0.0-R-2.4.1-py2.4 * ActivePython 2.4.3 Build 11, Python 2.1 & Python 2.5 (ye

Re: [Rpy] chisq problem

2007-09-21 Thread Eloi Ribeiro
Thank you so much Peter, finally it works. >>> from rpy import r (...) >>> c = [386,113,385,117,383,117] >>> r.assign("x",c) [386, 113, 385, 117, 383, 117] >>> r('chisq.test(matrix(x,nrow=3,ncol=2,byrow=TRUE))$p.value') 0.9535284154083411 >>> We'll add a note to the bug on sourceforge. Thanks ag

Re: [Rpy] chisq problem

2007-09-20 Thread Matthew Brett
Hi, Are you by any chance working on a 64-bit system? If so, have you tried using numpy and the patch I submitted recently? Matthew On 9/20/07, Eloi Ribeiro <[EMAIL PROTECTED]> wrote: > Hi Peter, > Still not working with us: > > >>> from rpy import r > (...) > >>> import Numeric > >>> c = Numer

Re: [Rpy] chisq problem

2007-09-20 Thread Peter
Eloi Ribeiro wrote: > This same problem is described here: > http://sourceforge.net/tracker/index.php?func=detail&aid=1602142&group_id=48422&atid=453021 > > That does look like the same issue - I personally haven't been affected yet. Please add a note to the bug on sourceforge, with the versi

Re: [Rpy] chisq problem

2007-09-20 Thread Eloi Ribeiro
Hi Peter, Still not working with us: >>> from rpy import r (...) >>> import Numeric >>> c = Numeric.array([[386, 113], [385, 117], [383, 117]]) >>> c array([[386, 113], [385, 117], [383, 117]]) >>> r.chisq_test(c)["p.value"] Traceback (most recent call last): File "", line 1, in ?

Re: [Rpy] chisq problem

2007-09-20 Thread Peter
Eloi Ribeiro wrote: > Hello again Peter. > > I noticed that I didn't had Numeric installed, now that part is solved, > but it didn't solve the problem. > > I still get a list of lists not an array: > > >>> c1=[386,385,383] > >>> c2=[113,117,117] > >>> c=r.cbind(c1,c2) > >>> c > [[386, 113],

Re: [Rpy] chisq problem

2007-09-20 Thread Eloi Ribeiro
Hello again Peter. I noticed that I didn't had Numeric installed, now that part is solved, but it didn't solve the problem. I still get a list of lists not an array: >>> c1=[386,385,383] >>> c2=[113,117,117] >>> c=r.cbind(c1,c2) >>> c [[386, 113], [385, 117], [383, 117]] >>> r.chisq_test(c) rpy.

Re: [Rpy] chisq problem

2007-09-20 Thread Peter
Eloi Ribeiro wrote: > Hi Peter, > Thanks for answering. Unfortunately your suggestion doesn't work with > the version we are using (Python 2.4.3, R 2.4.1, Rpy 1.0 RC2). It seems > that chisq function is waiting for a matrix as a double and not as a > list. How can we solve this? You are right -

Re: [Rpy] chisq problem

2007-09-20 Thread Eloi Ribeiro
Hi Peter, Thanks for answering. Unfortunately your suggestion doesn't work with the version we are using (Python 2.4.3, R 2.4.1, Rpy 1.0 RC2). It seems that chisq function is waiting for a matrix as a double and not as a list. How can we solve this? Thanks in advance. Output: -

Re: [Rpy] chisq problem

2007-09-19 Thread Peter
Eloi Ribeiro wrote: > Hi, > > We'r trying to do a chisq test from Python using Rpy but the p-value > result is different depending if we do it directly in R or Python. > So the mistake must be in the way that data is defined. > Can someone help us in this matter? > Thanks in advance. > > Outputs

[Rpy] chisq problem

2007-09-19 Thread Eloi Ribeiro
Hi, We'r trying to do a chisq test from Python using Rpy but the p-value result is different depending if we do it directly in R or Python. So the mistake must be in the way that data is defined. Can someone help us in this matter? Thanks in advance. Outputs: -