Plot the confidence interval for a model fit

indeed! that works. thanks. here for my future self:

using DataFrames, StatsPlots, GLM

data = DataFrame(x = rand(100));
data.y = 1 .+ 2*data.x .+ rand(100);
r = lm( @formula(y ~ x), data)
pred = predict(r, data, interval = :confidence, level = 0.95)

p = @df data scatter(:x, :y, leg = false)

# sort data on x
pred_s = pred[sortperm(data[!,:x]), : ]
x_s = sort(data[!, :x])

plot!(p, x_s, pred_s.prediction, linewidth = 2,
        ribbon = (pred_s.prediction .- pred_s.lower, pred_s.upper .- pred_s.prediction))