dimanche 25 novembre 2018

Performing a chi-quare test in Python 3 to test normality

I got the following file:

file

I want to test normality of this dataset. I want to do this via a chisquare test.

I start with this code, but I get results that are not correct.

import pandas as pd
df = pd.read_excel("Directory\ChiSquareTest.xlsx")
import numpy as pd
x=df.iloc[:,1:].values
import scipy.stats
from scipy.stats import chisquare
chisquare(x)

The results I get are:

result

where, as I perform it in excel, I get the following results:

chisquare = 5.53 p-value = 0.14

Following scipy stats website, these are the values I need to get. What am I doing wrong? And how can I extrapolate this result when I have multiple rows?

Thanks in advance,

Steven

Aucun commentaire:

Enregistrer un commentaire