Plotting coefplot

Here’s a pretty trivial example to get you started. This is definitely feasible.

julia> function coefplot(m)
       n = coefnames(m)[2:end] # no intercept
       vals = coef(m)[2:end]
       errors = stderr(m)[2:end]
       scatter(
           n,
           vals,
           legend = false,
           yerror = 1.96 .* errors,
           title = "Coefficient plot"
       )
       end

julia> df = DataFrame(y = rand(100), x1 = rand(100), x2 = rand(100));

julia> m = lm(@formula(y ~ x1 + x2), df);

julia> coefplot(m)

3 Likes