我對G.test函數使用了RVAideMemoire包。錯誤:至少有一項'x'必須是正數。如何解決這個錯誤?
> head(datamixG)
[,1] [,2]
[1,] 0 5
[2,] 0 5
[3,] 0 2
[4,] 0 0
[5,] 0 2
[6,] 0 1
當我試圖使用G.test時,我得到了這個錯誤。
> apply(datamixG, 1, G.test)
Error in chisq.test(x, p = p) :
at least one entry of 'x' must be positive
有沒有辦法消除錯誤,並有R分析0?
G.test測試以查看是否例如0:5與1:1的比率顯着不同。
這是什麼G.test你所說的 – rawr
http://www.inside-r.org/packages/cran/RVAideMemoire/docs/G .test 它與卡方相似,除了具有添加劑的優點。 http://udel.edu/~mcdonald/statgtestgof.html – user3605723
您可能需要'ks.test'或任何其他返回似然比檢驗統計量或執行擬合優度的函數。 –