Skip to content

Commit

Permalink
Merge pull request #8 from yufongpeng/release-0.2.2
Browse files Browse the repository at this point in the history
Release 0.2.2
  • Loading branch information
yufongpeng committed Mar 17, 2023
2 parents f44e7cb + 6ee3bf2 commit 49589e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AnovaFixedEffectModels"
uuid = "e4965305-65d6-464d-9c03-ae3e5cffadab"
authors = ["yufongpeng <54415349+yufongpeng@users.noreply.github.com> and contributors"]
version = "0.2.1"
version = "0.2.2"

[deps]
AnovaBase = "946dddda-6a23-4b48-8e70-8e60d9b8d680"
Expand Down
9 changes: 7 additions & 2 deletions src/anova.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ function anova(::Type{FTest},
ftest_nested(NestedModels{M}(models), df, dfr, dev, last(dev) / last(dfr))
end

anova(::Type{FTest}, aovm::NestedModels{M}) where {M <: FixedEffectModel} =
lrt_nested(aovm, dof_pred.(aovm.model), rss.(aovm.model), 1)
function anova(::Type{FTest}, aovm::NestedModels{M}) where {M <: FixedEffectModel}
dfr = round.(Int, dof_residual.(aovm.model))
dev = rss.(aovm.model)
ftest_nested(aovm, dof_pred.(aovm.model), dfr, dev, last(dev) / last(dfr))
end

anova(::Type{LRT}, aovm::NestedModels{M}) where {M <: FixedEffectModel} =
lrt_nested(aovm, dof_pred.(aovm.model), rss.(aovm.model), 1)
"""
lfe(formula::FormulaTerm, df, vcov::CovarianceEstimator = Vcov.simple(); kwargs...)
Expand Down
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ isapprox(x::NTuple{N, Float64}, y::NTuple{N, Float64}, atol::NTuple{N, Float64}
global aovf2 = AFE.anova(fem2, type = 3)
global aovl2 = AnovaGLM.anova(lm2, type = 3)
global aovfs = AFE.anova(NestedModels{FixedEffectModel}(fem0, fem1))
global aovfs2 = AFE.anova(fem0, fem1)
global aovls = AnovaGLM.anova(lm0, lm1)
@test !(@test_error test_show(aovf1))
@test !(@test_error test_show(aovf2))
Expand All @@ -61,7 +62,7 @@ isapprox(x::NTuple{N, Float64}, y::NTuple{N, Float64}, atol::NTuple{N, Float64}
@test last(dof(aovf1)) == dof(aovl1)[end - 1]
@test isapprox(first(deviance(aovf2)), first(deviance(aovl2)))
@test isapprox(first(teststat(aovf2)), first(teststat(aovl2)))
#@test isapprox(last(teststat(aovfs)), last(teststat(aovls)))
@test isapprox(teststat(aovfs)[2], teststat(aovfs2)[2])
end
end
end

2 comments on commit 49589e8

@yufongpeng
Copy link
Owner Author

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/79781

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.2.2 -m "<description of version>" 49589e8314c6fb65f92200c6d44e501a7703f4b3
git push origin v0.2.2

Please sign in to comment.