Issue related to Chi-Square Goodness of Fit Test Calculation

59 Views Asked by At

enter image description here

I am trying to solve the question mentioned below. Based on my calculation, I am getting 2,239,444.68 as Chi-Square value and Degree of Freedom as 5. Based on the Chi-Square Calculator, I am getting P-value of 0.0000 but the correct P-value of the below quiz question is mentioned as 0.32. Could you please provide solution for this Chi-Square Goodness of Fit Test?

1

There are 1 best solutions below

1
Sandipan Dey On

This is how you could compute the p-value for the chi-square goodness-of-fit test-statistic with 6-1=5 degrees of freedom (since x can take 6 values):

n <- 5
p <- 0.57

x <- 0:5
df <- data.frame(x=x, 
      observerd=c(25,165,429,500,339,92), 
      expected=1550*dbinom(x, n, p))

df
#  x observerd  expected
#1 0        25  22.78631
#2 1       165 151.02553
#3 2       429 400.39328
#4 3       500 530.75388
#5 4       339 351.77873
#6 5        92  93.26227

chisq.statistic <- sum((df$observerd - df$expected)^2 /df$expected)
chisq.statistic
# [1] 5.815257

pchisq(chisq.statistic, df=length(x)-1, lower.tail = FALSE) # p-value
# [1] 0.3246123

Hence, we can't reject the null-hypothesis at 5% or 10% level of significance.

You can use r function chisq.test() too, in order to obtain the same result:

chisq.test(c(25,165,429,500,339,92), p = dbinom(x, n, p))
# 
# Chi-squared test for given probabilities

# data:  c(25, 165, 429, 500, 339, 92)
# X-squared = 5.8153, df = 5, p-value = 0.3246