I've runned some algorithms and wanted to make some statistics analysis with the results. I have two vectors with the averages of the error rate.
With R, using the line below I would get everything.
t.test(methodresults1,methodresults2,var.equal=FALSE,paired=FALSE,alternative="less")
Since I'm using Python, I wanted to use Rpy2 project.
I tried that:
import rpy2.robjects as R
# methodresults1 and methodresults2 are numpy arrays.
# kolmogorov test
normality_res = R.r['ks.test'](R.FloatVector(methodresults1.tolist()),'pnorm',mean=R.FloatVector(methodresults1.mean().tolist()),sd=R.FloatVector(methodresults1.std().tolist())))
# t-test
res = R.r['t.test'](R.FloatVector(methodresults1.tolist()),R.FloatVector(methodresults2.tolist()),alternative='two.sided',var.equal=FALSE,paired=FALSE)
res.rx('p.value')[0][0]
res.rx('statistic')[0][0]
res.rx('parameter')[0][0]
I wasn't able to perform both tests.
I found also that the problem with the t-test is with the var.equal statement and it gives me an * SyntaxError: keyword can't be an expression (, line 1).
Extra question: Is there a better way to work with numpy and Rpy2?