如果您无法具体回答此问题,请勿标记重复
而且我没有使用 lapply 问题也与此不匹配
size income.gap count1 count2
1 1000000 656 656
2 1000000 1443 1443
3 1000000 1232 1232
4 1000000 1036 1036
5 1000000 540 540
6 1000000 227 227
7 1000000 94 94
8 1000000 38 38
9 1000000 22 22
10 1000000 4 4
gap.data.conf <- ddply(data, ~ size, summarize,
gap = mean(income[gender == "Male"], na.rm = TRUE) - mean(income[gender == "Female"], na.rm = TRUE),
upper = -t.test(income ~ gender)$conf.int[1],
lower = -t.test(income ~ gender)$conf.int[2])
错误:
Error in t.test.default(x = c(35000L, 24000L, 24000L), y = 26000L) :
not enough 'y' observations
任何人都可以指导我,为什么没有足够的 y 观察,尽管计数是相等的,如上表所示?