2

在 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

这是我的数据

4

1 回答 1

0

问题已解决:loess 无法处理带零的权重向量。

于 2018-04-25T21:00:13.513 回答