在 R 中,使用 ggplot2 包,我有以下两行:
ggplot(data, aes(x = x, y = Pinera)) +
geom_point(shape = 1) +
geom_smooth(method = loess, se = TRUE)
ggplot(data, aes(x = x, y = Pinera, weight = pesos)) +
geom_point(shape = 1) +
geom_smooth(method = loess, se = TRUE)
第一个为我的数据提供了一条带有阴影置信区间的未加权平滑曲线,但是当我添加权重时,尽管我声明了,但置信区间区域消失了se = TRUE
。
这是我的数据