Skip to content

Commit 88490cf

Browse files
try..catch all of _show_fit_stats
1 parent 659dc51 commit 88490cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/statsmodel.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,14 @@ end
196196
_show_fit_stats(io::IO, model::TableModels) = nothing
197197

198198
function _show_fit_stats(io::IO, model::TableRegressionModel)
199-
println("R²: ", round(r2(model), sigdigits=4),
200-
"\t Adjusted R²: ", round(adjr2(model), sigdigits=4))
201199
try
200+
println("R²: ", round(r2(model), sigdigits=4),
201+
"\t Adjusted R²: ", round(adjr2(model), sigdigits=4))
202+
202203
fstat = fstatistic(model)
203204
println(io, fstat)
204205
catch e
205-
if !(isa(e, MethodError) && e.f == fstatistic)
206+
if !(isa(e, MethodError) && (e.f == r2 || e.f == adjr2 || e.f == fstatistic))
206207
rethrow(e)
207208
end
208209
end

0 commit comments

Comments
 (0)