Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/likelihoodratiotest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,20 @@
return true
end

function StatsModels.isnested(m::MixedModel...)::Bool
m = collect(m)

Check warning on line 291 in src/likelihoodratiotest.jl

View check run for this annotation

Codecov / codecov/patch

src/likelihoodratiotest.jl#L290-L291

Added lines #L290 - L291 were not covered by tests

for i in eachindex(m)[begin:end-1]
StatsModels.isnested(m[i], m[i+1]) || return false
end
return true

Check warning on line 296 in src/likelihoodratiotest.jl

View check run for this annotation

Codecov / codecov/patch

src/likelihoodratiotest.jl#L293-L296

Added lines #L293 - L296 were not covered by tests
end

function StatsModels.lrtest(m::MixedModel...)
StatsModels.isnested(m...) || throw(ArgumentError("Models are not nested"))
likelihoodratiotest(m...)

Check warning on line 301 in src/likelihoodratiotest.jl

View check run for this annotation

Codecov / codecov/patch

src/likelihoodratiotest.jl#L299-L301

Added lines #L299 - L301 were not covered by tests
end

function _iscomparable(
m1::TableRegressionModel{<:Union{LinearModel,GeneralizedLinearModel}}, m2::MixedModel
)
Expand Down
Loading