Weighted linear regression with confidence interval

julia> df = DataFrame(x = [1, 2, 3.], y = [1, 3, 4.])

julia> df.w = [2, 3, 4]

julia> fit1 = glm(@formula(y ~ x), df, Normal(), wts = df.w)

julia> predict(fit1, df[:, [:x]], interval=:confidence)
3×3 DataFrame
│ Row │ prediction │ lower    │ upper    │
│     │ Float64?   │ Float64? │ Float64? │
├─────┼────────────┼──────────┼──────────┤
│ 1   │ 1.24       │ 0.923618 │ 1.55638  │
│ 2   │ 2.68       │ 2.50221  │ 2.85779  │
│ 3   │ 4.12       │ 3.87927  │ 4.36073  │
3 Likes