是否有用于多组拟合优度卡方检验的 R 函数?
S.giganteus <- matrix(c(0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 1, 7, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 0, 0, 0, 1, 4, 1, 0, 0), ncol = 7, byrow = T)
colnames (S.giganteus) <- c("s1", "s2", "s3", "s4", "s5", "s6", "s7")
rownames (S.giganteus) <- c("feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec", "jan")
S.giganteus <- as.table(S.giganteus)
P.melanotus <- matrix(c(0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 4, 7, 6, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 7, 2, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 4, 1, 1, 0, 0, 0, 0, 0, 3, 5, 0, 0, 0, 0, 0, 3, 8, 1, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0))
colnames (P.melanotus) <- c("s1", "s2", "s3", "s4", "s5", "s6", "s7")
rownames (P.melanotus) <- c("feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec", "jan")
P.melanotus <- as.table(P.melanotus)
我不知道这是否可能,但我想做多项拟合优度卡方检验。换句话说,我想将一个月内不同阶段的S.giganteus个体的比例与P.melanotus的实际个体数量进行比较。 由于抽样工作的差异以及因此组大小的不平等,我无法进行正常的卡方检验。 我希望避免每月单独进行测试,以减少出现 I 类错误的可能性。 我不知道从哪里开始,也不知道这是否可能,因为我在网上找不到任何东西。当然,我也愿意接受其他选择。
S.giganteus <- matrix(c(0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 6, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 1, 7, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 0, 0, 0, 1, 4, 1, 0, 0), ncol = 7, byrow = T)
colnames (S.giganteus) <- c("s1", "s2", "s3", "s4", "s5", "s6", "s7")
rownames (S.giganteus) <- c("feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec", "jan")
S.giganteus <- as.table(S.giganteus)
P.melanotus <- matrix(c(0, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 4, 7, 6, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 7, 2, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 4, 1, 1, 0, 0, 0, 0, 0, 3, 5, 0, 0, 0, 0, 0, 3, 8, 1, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0))
colnames (P.melanotus) <- c("s1", "s2", "s3", "s4", "s5", "s6", "s7")
rownames (P.melanotus) <- c("feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec", "jan")
P.melanotus <- as.table(P.melanotus)
I do not know if this is even possible but I would like to do a multinomial goodness of fit chi-squared test. In other words, I would e.g. like to compare the proportions of S.giganteus individuals at different stages in a month to the actual number of individuals from P.melanotus.
I can't do a normal Chi-squared test because of differences in sampling effort and therefore unequal group sizes.
I would like to avoid testing each month individually to reduce my chances of a type I error.
I have no clue where to start or even if this is possible because I can't find anything online. I'm also open to other options of course.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定此内容的目标是什么,但这就是我发现的。我确实想说,我不确定你所说的不均匀的组大小是什么意思,因为两者都是 12 x 7。
然后我应用了卡方-
由于警告 –
我使用了 MC 模拟:
I'm not sure what the objective is with this content, but this is what I found. I do want to say that I'm not sure what you mean about uneven group sizes because both come to 12 x 7.
Then I applied Chi-squared-
Due to the warning–
I used MC simulation: