Skip to content

Commit e029ef4

Browse files
authored
Fix coeftable when passing level keyword argument (#311)
1 parent dca12e1 commit e029ef4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/statsmodel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ StatsAPI.coefnames(model::TableModels) = coefnames(model.mf)
185185

186186
# coeftable implementation
187187
function StatsAPI.coeftable(model::TableModels; kwargs...)
188-
ct = coeftable(model.model, kwargs...)
188+
ct = coeftable(model.model; kwargs...)
189189
cfnames = coefnames(model.mf)
190190
if length(ct.rownms) == length(cfnames)
191191
ct.rownms = cfnames

test/statsmodel.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ StatsAPI.fit(::Type{DummyMod}, x::Matrix, y::Vector) =
1212
DummyMod(collect(1:size(x, 2)), x, y)
1313
StatsAPI.response(mod::DummyMod) = mod.y
1414
## dumb coeftable: just prints the "beta" values
15-
StatsAPI.coeftable(mod::DummyMod) =
15+
StatsAPI.coeftable(mod::DummyMod; level::Real = 0.95) =
1616
CoefTable(reshape(mod.beta, (size(mod.beta,1), 1)),
1717
["'beta' value"],
1818
["" for n in 1:size(mod.x,2)],
@@ -159,7 +159,7 @@ Base.show(io::IO, m::DummyModTwo) = println(io, m.msg)
159159
@test length(predict(m, d2)) == 4
160160

161161
## test copying of names from Terms to CoefTable
162-
ct = coeftable(m)
162+
ct = coeftable(m; level = 0.9)
163163
@test ct.rownms == ["(Intercept)", "x1", "x2", "x1 & x2"]
164164
@test termnames(m) == ("y", ["(Intercept)", "x1", "x2", "x1 & x2"])
165165

0 commit comments

Comments
 (0)