푸 아송 분포에 대한 적합도 검정을 사용하여 P- 값을 계산하려고합니다.
관측 된 데이터 포인트는 118 64 18이고 예상되는 데이터 포인트는 다음과 같습니다. 120 61.25 18.8
Poisson 분포로 확률을 계산 했으므로 df 값은 3-1-1 = 1이됩니다.
나는 R에서 df = 4를 얻었습니다.
이것이 내가 R에 넣은 것입니다.
Chi.Observed <- c(118,64,18)
Chi.Expected <- c(120,61.2,18.8)
chisq.test(Chi.Observed, Chi.Expected)
대답은 다음과 같습니다.
Pearson's Chi-squared test
Chi.Observed and Chi.Expected
X-squared = 6, df = 4, p-value = 0.1991
이 문제에 대해 생각하고 위의 Ben의 답변을 읽은 후 설명 및 / 또는 답변이 있다고 생각합니다. 이 문제는 올바른 형태의 Chisq 검정을 사용하고 올바른 자유도를 얻는 두 가지 문제입니다.
chisq.test의 올바른 형식을 사용하는 첫 번째 문제. 다음 형식을 사용하면 chisq.test(x, y)
3x3 분할 표가 생성되고 너무 낮은 p- 값이 생성됩니다.
아래 test1을 참조하십시오. test1$observed
및 test1$expected
정확한 입력을 반환하지 않는다.
올바른 형식 chisq.test(x, p) #where p is the expected probability of x.
은 다음과 같습니다. 이것은 아래 test2와 같습니다. 이제 p- 값이 19 %에서 90 %로 변경되었습니다. (이것은 내 대답이지만 더 나은 통계 학자에게 맡길 것입니다.)
자유도를 1로 조정하려면 Ben Bolker의 답변을 참조하십시오. 이제 결과는 p- 값이 66 % 인 test3으로 표시됩니다.
이것이 허용 가능한 설명을 제공하기를 바랍니다.
Chi.Observed <- c(118,64,18)
Chi.Expected <- c(120,61.2,18.8)
test1<-chisq.test(Chi.Observed, Chi.Expected) # this is 3x3 contgency table.
test1
# Pearson's Chi-squared test
#
# data: Chi.Observed and Chi.Expected
# X-squared = 6, df = 4, p-value = 0.1991
#
#This result is incorrect as it...
# forms a 3x3 contingency table as shown by:
test1$observed # observed counts
test1$expected # expected counts under the null
#chisq using the expected probabilities:
test2<-chisq.test(Chi.Observed, p= Chi.Expected/sum(Chi.Expected))
test2
# Chi-squared test for given probabilities
#
# data: Chi.Observed
# X-squared = 0.19548, df = 2, p-value = 0.9069
#adjust degrees of freedon as per Ben's answer
test3 <- chisq.test(Chi.Observed, p = Chi.Expected/sum(Chi.Expected))
test3$parameter <- c(df=1)
test3$p.value <- pchisq(test3$statistic, df=test3$parameter, lower.tail=FALSE)
test3
# Chi-squared test for given probabilities
#
# data: Chi.Observed
# X-squared = 0.19548, df = 1, p-value = 0.6584
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다