Skip to content

Commit

Permalink
Fix coeftable when passing level keyword argument (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack authored Aug 16, 2024
1 parent dca12e1 commit e029ef4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/statsmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ StatsAPI.coefnames(model::TableModels) = coefnames(model.mf)

# coeftable implementation
function StatsAPI.coeftable(model::TableModels; kwargs...)
ct = coeftable(model.model, kwargs...)
ct = coeftable(model.model; kwargs...)
cfnames = coefnames(model.mf)
if length(ct.rownms) == length(cfnames)
ct.rownms = cfnames
Expand Down
4 changes: 2 additions & 2 deletions test/statsmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ StatsAPI.fit(::Type{DummyMod}, x::Matrix, y::Vector) =
DummyMod(collect(1:size(x, 2)), x, y)
StatsAPI.response(mod::DummyMod) = mod.y
## dumb coeftable: just prints the "beta" values
StatsAPI.coeftable(mod::DummyMod) =
StatsAPI.coeftable(mod::DummyMod; level::Real = 0.95) =
CoefTable(reshape(mod.beta, (size(mod.beta,1), 1)),
["'beta' value"],
["" for n in 1:size(mod.x,2)],
Expand Down Expand Up @@ -159,7 +159,7 @@ Base.show(io::IO, m::DummyModTwo) = println(io, m.msg)
@test length(predict(m, d2)) == 4

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

Expand Down

2 comments on commit e029ef4

@palday
Copy link
Member

@palday palday commented on e029ef4 Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/113251

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.4 -m "<description of version>" e029ef4b34d1660ec23b147e3d91bccd1b7ac286
git push origin v0.7.4

Please sign in to comment.