Python scipy chisquare gibt andere Werte als R chisquare zurück

Ich versuche es zu benutzenscipy.stats.chisquare. Ich habe ein Spielzeugbeispiel gebaut:

In [1]: import scipy.stats as sps

In [2]: import numpy as np

In [3]: sps.chisquare(np.array([38,27,23,17,11,4]), np.array([98, 100, 80, 85,60,23]))
Out[11]: (240.74951271813072, 5.302429887719704e-50)

Das gleiche Beispiel inR kehrt zurück:

> chisq.test(matrix(c(38,27,23,17,11,4,98,100,80,85,60,23), ncol=2))

Pearson's Chi-squared test

data:  matrix(c(38, 27, 23, 17, 11, 4, 98, 100, 80, 85, 60, 23), ncol = 2)
X-squared = 7.0762, df = 5, p-value = 0.215

Was mache ich falsch?

Vielen Dank

Antworten auf die Frage(1)

Ihre Antwort auf die Frage