I am learning logistic regression modeling from the book Applied Logistic Regression by Hosmer.
I need to create a plot named "create univariable smoothed scatterplot on logit scale", something like this one (Figure 4.2 page 107):

Can anyone help? Thanks.
edit 01
Thanks for all the answers. I tried creating the plot, and discover that smooth.spline created the graph by using percentage (nrow((df[df[,"dfree"]==1,]))/nrow(df)), rather than logit (log(nrow(df[df[,"dfree"]==1,])/nrow(df[df[,"dfree"]==0,]))) when creating the y-axis. Yes, the graph looks similar, but I wonder if we can create an exact copy of that? Thanks.
One more thing, when using logit, some of the logit value in the data.frame is -Inf and Inf, which is not allowed in smooth.spline.
edit 02
I have further question concerning my edit:
What if I manually dropped all Inf and -Inf in my data.frame and do smooth.spline on that data.frame? Is it appropriate?
