[R-sig-ME] ggplot, loess function without 95%CI option
ph||||p@@|d@y @end|ng |rom mp|@n|
Tue Oct 15 06:54:50 CEST 2019
This isn't really the appropriate forum for that question because the
question has nothing to do with mixed-effects models.
That said, it really helps to just read the documentation:
The default for loess in modern ggplot2 is indeed the 95% CI. You can
adjust this with the level option, e.g.
ggplot(mtcars, aes(x = mpg, y = hp)) +
geom_smooth(method = 'loess', fill='darkred', level=0.68) +
geom_smooth(method = 'loess')
Note that level=0.68 corresponds to the SE case and provides a shaded
area about half as wide as the the default case, which is in line with
the Wald approximation that 95% CI = ±2 * SE.
On 11/10/2019 20:36, Slik, F.W.P. van der wrote:
> Hi listers,
> In ggplot, the loess function is only available with SE. The 95%CI option (level=.95) is unavailable, unfortunately.
> I think there is demand for such an option. Well, at least I would like to make use of it.
> Several contributors to stackoverflow have expressed their need and some of them have tried to program a workaround for this issue:
> Unfortunately, their workarounds have their shortcomings.
> Has anyone a solution for the missing 95%CI option for loess in ggplot? It would be wonderful if the 95%CI band would look like the se band in the ggplot.
> Thanks in advance.
> Cheers, Frans van der Slik
> [[alternative HTML version deleted]]
> R-sig-mixed-models using r-project.org mailing list
More information about the R-sig-mixed-models