How to extract the Std. Error of a linear regression model by GLM.jl?
julia> using GLM
julia> x = rand(10); y = rand(10);
julia> lr = lm(@formula(y~x), (;x, y))
StatsModels.TableRegressionModel{LinearModel{GLM.LmResp{Vector{Float64}}, GLM.DensePredChol{Float64, LinearAlgebra.CholeskyPivoted{Float64, Matrix{Float64}, Vector{Int64}}}}, Matrix{Float64}}
y ~ 1 + x
Coefficients:
─────────────────────────────────────────────────────────────────────────
Coef. Std. Error t Pr(>|t|) Lower 95% Upper 95%
─────────────────────────────────────────────────────────────────────────
(Intercept) 0.539296 0.158513 3.40 0.0093 0.173764 0.904827
x 0.00747856 0.255377 0.03 0.9774 -0.581422 0.59638
─────────────────────────────────────────────────────────────────────────
I want to extract the 0.255377
value. The lr
object has many fields and sub-fields that are time-consuming to probe. I don’t know how to extract the t
value of 0.03
too.