diff --git a/Project.toml b/Project.toml index 422a5af..5df91c9 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MixedModelsSerialization" uuid = "b32ace64-3998-4ca6-afd0-a0db4a0482b2" +version = "0.2.2" authors = ["Phillip Alday "] -version = "0.2.0" [deps] GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a" @@ -22,15 +22,22 @@ Effects = "8f03c58b-bd97-4933-a826-f71b64d2cca2" MixedModelsSerializationEffectsExt = ["DataFrames", "Effects"] [compat] +Aqua = "0.8" DataFrames = "1" Effects = "1" GLM = "1" JLD2 = "0.4.22, 0.5, 0.6" +LinearAlgebra = "1" MixedModels = "5.0.3" +MixedModelsDatasets = "0.2" +SparseArrays = "1" StatsAPI = "1" StatsBase = "0.33, 0.34" -StatsFuns = "1" +StatsFuns = "1, 2" StatsModels = "0.7" +Suppressor = "0.2" +Test = "1" +TestSetExtensions = "4" julia = "1.10" [extras] diff --git a/src/MixedModelsSerialization.jl b/src/MixedModelsSerialization.jl index 4295c1a..c77f4fb 100644 --- a/src/MixedModelsSerialization.jl +++ b/src/MixedModelsSerialization.jl @@ -130,7 +130,10 @@ function StatsAPI.coeftable(mms::MixedModelSummary) co = copy(coef(mms)) se = copy(stderror(mms)) z = co ./ se - pvalue = 2 .* normccdf.(abs.(z)) + # use the same code path as MixedModels.jl's own coeftable so that the + # values agree bit-for-bit: Distributions' ccdf(Chisq(1), x) delegates + # to StatsFuns.chisqccdf + pvalue = chisqccdf.(1, abs2.(z)) names = copy(coefnames(mms)) return StatsBase.CoefTable(hcat(co, se, z, pvalue), @@ -294,7 +297,7 @@ function Base.show(io::IO, ::MIME"text/plain", m::LinearMixedModelSummary) join(io, (re.nlevs for re in values(m.reterms)), ", ") println(io) println(io, "\n Fixed-effects parameters:") - return show(io, coeftable(m)) + return show(io, MIME("text/plain"), coeftable(m)) end ##### diff --git a/test/runtests.jl b/test/runtests.jl index 2d314b3..76eab6d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,7 @@ include("set_up_tests.jl") @testset ExtendedTestSet "Aqua" begin - Aqua.test_all(Effects; ambiguities=false) + Aqua.test_all(MixedModelsSerialization; ambiguities=false) end @testset "StatsAPI" begin @@ -15,7 +15,8 @@ end for f in statsapi @test f(fm1) == f(mms) end - @test sprint(show, coeftable(fm1)) == sprint(show, coeftable(mms)) + @test sprint(show, MIME("text/plain"), coeftable(fm1)) == + sprint(show, MIME("text/plain"), coeftable(mms)) @test_throws ArgumentError loglikelihood(mms2) end @@ -38,7 +39,8 @@ end for f in mixedmodels @test f(fm1) == f(mms) end - @test sprint(show, coeftable(fm1)) == sprint(show, coeftable(mms)) + @test sprint(show, MIME("text/plain"), coeftable(fm1)) == + sprint(show, MIME("text/plain"), coeftable(mms)) end @testset "GLM" begin