Scatterplot with regression line: confidence interval or standard error?

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
Enrique Prada
Posts: 2
Joined: Wed Dec 03, 2025 11:36 am

Scatterplot with regression line: confidence interval or standard error?

Post by Enrique Prada »

Hi, I have a doubt regarding the option "standard error" of the regression line in scatterplots. I have tried to find if this issue appeared in previous posts of this forum, but I haven't found a clarification about this (apologies if I missed it).

My doubt is whether the "standard error" option generates a confidence interval around the regression line, or if it generates a standard error band (i.e., a band with +-1 standard error around the regression line). On the one hand, I expected that this option would generate a confidence interval, because as far as I know, it is more common to provide a confidence interval. On the other hand, however, the button to include this option says "standard error", and the documentation of the R function that jamovi uses to create scatterplots (scatr::scat) also alludes to standard errors.

This is the R code that jamovi uses to produce a scatterplot with a regression line and a band around the regression line, with some data that I had (I obtained this code using the syntax mode of jamovi - the version of jamovi that I use is 2.3.28.0):

scatr::scat(
data = data,
x = GDP per capita,
y = Women MPs,
line = "linear",
se = TRUE)

In the documentation of scat {scatr} they say: "se: TRUE or FALSE (default), show the standard error for the regression line"

However, as I thought that providing confidence intervals would be more natural, I wanted to double check this. In order to do that, I generated 2 scatterplots in R with ggplot. One had a regression line with a confidence interval (95%) and the other had a regression line with a standard error band. Then I compared them with the scatterplot generated by jamovi, and it looked like the jamovi scatterplot coincided with the scatterplot with a confidence interval! So now I think that perhaps there's a mistake in the documentation and what jamovi produces are confidence intervals instead of standard errors. Could somebody please check this and let me know? If you want, I can provide the R code that I used, and screenshots of the graphs that I generated (although I don't know how to upload images to the forum post).

Thank you in advance. Best,
Enrique
User avatar
jonathon
Posts: 2921
Joined: Fri Jan 27, 2017 10:04 am

Re: Scatterplot with regression line: confidence interval or standard error?

Post by jonathon »

hi,

so taking a quick look at the source code, we do the following:

ggplot2::geom_smooth(
method = self$options$lineMethod,
se = self$options$lineSE,
formula = y ~ x,
color = theme$color[1],
fill = theme$fill[2]
)

https://github.com/jamovi/jmvplots/blob ... .R#L67-L85

the key argument seems to be `se`, which any normal person would interpret as "standard error". however the documentation says

"Display confidence band around smooth?"

which rather tends to suggest `se` plots a confidence interval, rather than a standard error. let me escalate this.

jonathon
User avatar
Ravi
Posts: 206
Joined: Sat Jan 28, 2017 11:18 am

Re: Scatterplot with regression line: confidence interval or standard error?

Post by Ravi »

Hi Enrique,

Thank you for bringing this to our attention! I've looked into it, and you are absolutely right about it being the 95% confidence interval instead of the SE. We were mislead by the naming of the variable in ggplot2 (as jonathon mentioned). We will make changes to the option name so that at least it will be clear in jamovi that it represents the confidence interval. I will let you know when I've made the necessary changes.

Cheers,
Ravi
Enrique Prada
Posts: 2
Joined: Wed Dec 03, 2025 11:36 am

Re: Scatterplot with regression line: confidence interval or standard error?

Post by Enrique Prada »

Hi,

Great, thank you Jonathon and Ravi for checking this and letting me know!

Best,
Enrique
User avatar
jonathon
Posts: 2921
Joined: Fri Jan 27, 2017 10:04 am

Re: Scatterplot with regression line: confidence interval or standard error?

Post by jonathon »

2.7.14 is out, including the fixes
Post Reply