Skip to content

Commit 11312e4

Browse files
authored
construct coeftable with hints for p-val and test-statistic cols (#260)
1 parent 4845f6b commit 11312e4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/linearmixedmodel.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ function StatsBase.coeftable(m::MixedModel)
176176
hcat(co, se, z, pvalue),
177177
["Estimate", "Std.Error", "z value", "P(>|z|)"],
178178
names,
179-
4,
179+
4, # pvalcol
180+
3, # teststatcol
180181
)
181182
end
182183

test/pls.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,10 @@ end
364364
@test coef(model2)[2] == -0.0
365365
@test last(fixef(model)) (last(fixef(model2)) * 1.5)
366366
end
367+
368+
@testset "coeftable" begin
369+
ds = MixedModels.dataset(:dyestuff);
370+
fm = fit(MixedModel, @formula(yield ~ 1 + (1|batch)), ds);
371+
ct = coeftable(fm);
372+
@test [3,4] == [ct.teststatcol, ct.pvalcol]
373+
end

0 commit comments

Comments
 (0)