返回

加权比例 - 上置信区间小于下置信​​区间

发布时间:2022-08-13 17:40:08 211

我正在尝试计算加权比例和置信区间。但是,我得到的估计值给出了一个上限 (97.5%) 置信区间,该置信区间小于下限 (2.5%) 置信区间。我无法理解为什么会发生这种情况或如何解决此类问题/错误?任何建议表示赞赏?

下面的测试数据产生了同样的问题。

test <- structure(list(e_tereticornis = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0), rel.abu.tree.in.hr = c(4.6, 4.6, 
4.6, 4.6, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 
31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 2.1, 2.1, 2.1, 
11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 
19.2, 19.2, 10, 10, 10, 10, 10, 10, 10, 10, 3, 3, 5, 5, 5, 0.8, 
0.8, 0.8, 0.8, 0.8, 0.8, 0.7, 0.7, 0.7, 0.7, 0.7, 0.6, 0.6, 0.6, 
0.6, 31.8, 31.8, 0.1, 2.1, 11.4, 10, 10, 10, 10, 10, 10, 10, 
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 
3, 3, 0.7, 0.7, 0.7, 0.7, 0.7, 4.6, 31.8, 31.8, 31.8, 31.8, 31.8, 
31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 
31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 
31.8, 31.8, 31.8, 31.8, 1.8, 1.8, 11.4, 11.4, 11.4, 11.4, 11.4, 
11.4, 19.2, 19.2, 10, 10, 3, 3, 3, 3, 3, 3, 3.6, 4.6, 4.6, 4.6, 
31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 
31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 
31.8, 31.8, 1.8, 1.8, 1.8, 1.8, 11.4, 11.4, 11.4, 11.4, 19.2, 
19.2, 19.2, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3.6, 3.6, 3.6, 4.6, 
4.6, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 31.8, 
31.8, 31.8, 31.8, 2.1, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 
19.2, 19.2, 19.2, 19.2, 19.2, 19.2, 19.2, 19.2, 19.2, 19.2, 19.2, 
19.2, 19.2, 19.2, 19.2, 19.2, 10, 10, 10, 10, 3, 3, 5, 5)), row.names = c(NA, 
-250L), class = "data.frame")

我正在尝试使用survey::svycipropR 中的函数计算加权比例。

# Load package
library(survey)

# Create survey.design object
survey_test <- svydesign(ids = ~1, data = test, weights = ~rel.abu.tree.in.hr)

# Calculate weighted proportion and 95% confidence interval
# Here test$e_tereticornis is what I wish to obtain the weighted proportion and 
# confidence interval for and test$rel.abu.tree.in.hr is my weighting variable
svyciprop(~e_tereticornis, design = survey_test, method = "lo")

# Returned weighted proportion and 95% confidence interval
                            2.5% 97.5%
e_tereticornis 0.000852 0.000348     0

我已经尝试了所有其他方法来估计survey::svyciprop()函数中可能的比例和置信区间,但它们都会产生相同的问题。这些方法包括method == "li"、method == "as"、method == "be"、method == "me"和method == "xl"。

特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像
相关帖子