# What is represented by the y-axis in a loess smoothing curve?

I'm working on the Titanic data and I plotted local regression curves for a couple predictors.

library('vcdExtra')
data(Titanicp)

ggplot(Titanicp, aes(age, as.numeric(survived)-1, color=sex)) +
stat_smooth(method="loess", formula=y~x,
alpha=0.2, size=2, aes(fill=sex)) + facet_grid(~pclass)


I thought the y-axis was probability, but it exceeds 1. What is it?

• Your code is not reproducible - there is no object imp.train defined with that code. – Reinstate Monica Jan 22 at 1:01
• Let's underline that once you've specified age, class, sex you're often not playing with much data for each smoothed value, regardless of neighbouring values providing support. So uncertainty about the smooths should be no surprise, and as @peteR flags, the routine doesn't know about the bounds on the response. – Nick Cox Jan 22 at 9:01

The plot gives you the answer - it is the variable as.numeric(Survived) - 1. So, whatever your Survived variable is, this is converting it to a number, then subtracting one. The result of that operation is what is plotted on the vertical axis. Since you have used a loess fit, the curves are showing a smoothed estimate of this variable.