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
Scatterplot with regression line: confidence interval or standard error?
-
Enrique Prada
- Posts: 2
- Joined: Wed Dec 03, 2025 11:36 am
Re: Scatterplot with regression line: confidence interval or standard error?
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
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
Re: Scatterplot with regression line: confidence interval or standard error?
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
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?
Hi,
Great, thank you Jonathon and Ravi for checking this and letting me know!
Best,
Enrique
Great, thank you Jonathon and Ravi for checking this and letting me know!
Best,
Enrique
Re: Scatterplot with regression line: confidence interval or standard error?
2.7.14 is out, including the fixes