Hello!
I'm new to R and am trying to use stat_smooth to add both a smooth line and accompanying standard errors to a plot.
However, the standard errors don't appear to be spanning the entire width of the plot. See here: https://imgur.com/a/G89j7WW
My code is as follows:
Antennate <- ggplot(FemNumeric,
aes(x = Mass,
y = as.numeric(Antennate))) +
geom_point(size = 7.5,
alpha = 1/2) +
labs( x = "Mass of female cricket (g)",
y = "Time to antennate (s)",
title = "Antennation")+
scale_x_continuous (limits=c(0,1.30),
expand=c(0,0),
breaks=seq(0, 1.25, 0.25)) +
scale_y_continuous(limits=c(0,650),
expand=c(0,0),
breaks=seq(0, 600, 100)) +
theme_classic(base_size = 30) +
stat_smooth(method = "lm",
col = "black")
fit3 <- lm(Antennate ~ Mass,
data = FemNumeric)
I'd appreciate some help in resolving this.
Thank you!