Add Regression manually

71 views Asked by At

enter image description here

Hi!

I just added an regression manually to the plot. But how can I remove the red part between the intervals?

1

There are 1 answers

6
Quinton.Quagliano On

If you are using ggplot2, you just need an extra argument to geom_smooth():

base::library(package = ggplot2)

data("mtcars")

ggplot2::ggplot(
  data   = mtcars,
  mapping = ggplot2::aes(
    x = mpg, 
    y = hp
  )
) +
  ggplot2::geom_point() +
  ggplot2::geom_smooth(method = lm, se = FALSE)

Make sure to add that se = FALSE there, that is what the red bar is. If this answer helps solve your issue please mark as correct.

EDIT: for sjPlot PACKAGE

Use the following argument:

ci.lvl = NA