lxrnax
lxrnax

Reputation: 9

Add Regression manually

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?

Upvotes: -1

Views: 72

Answers (1)

Quinton.Quagliano
Quinton.Quagliano

Reputation: 836

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

Upvotes: 1

Related Questions