Skip to content

Commit

Permalink
Show F-statistic for regression models
Browse files Browse the repository at this point in the history
  • Loading branch information
OndrejSlamecka committed Apr 25, 2021
1 parent 950ba92 commit 8060e86
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/statsmodel.jl
Expand Up @@ -193,6 +193,14 @@ function Base.show(io::IO, model::TableModels)
if model isa TableRegressionModel
println(io)
println("R²: ", round(r2(model), sigdigits=4))
try
fstat = fstatistic(model)
println(io, fstat)
catch e
if !(isa(e, MethodError) && e.f == fstatistic)
rethrow(e)
end
end
end
catch e
if isa(e, ErrorException) && occursin("coeftable is not defined", e.msg)
Expand All @@ -202,3 +210,5 @@ function Base.show(io::IO, model::TableModels)
end
end
end

fstatistic(m::TableRegressionModel) = fstatistic(m.model)

0 comments on commit 8060e86

Please sign in to comment.