Skip to content

Commit

Permalink
Merge branch 'anova-interaction-condition'
Browse files Browse the repository at this point in the history
Fixes issue #463
  • Loading branch information
jarioksa committed Jan 29, 2022
2 parents 790184c + 464be5e commit 47e9fc3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/anova.ccabyterm.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@
trms <- scope
else
trms <- drop.scope(object)
trmlab <- trms[trms %in% attr(terms(object$terminfo),
"term.labels")]
## Condition() not considered marginal
alltrms <- intersect(attr(terms(object$terminfo), "term.labels"),
attr(terms(object), "term.labels"))
trmlab <- intersect(alltrms, trms)
if (length(trmlab) == 0)
stop("the scope was empty: no available marginal terms")
## baseline: all terms
Expand All @@ -87,7 +89,7 @@
if (is.null(ass))
stop("old style result object: update() your model")
## analyse only terms of 'ass' thar are in scope
scopeterms <- which(attr(terms(object$terminfo), "term.labels") %in% trms)
scopeterms <- which(alltrms %in% trmlab)
mods <- lapply(scopeterms, function(i, ...)
permutest(ordConstrained(Y, X[, ass != i, drop=FALSE], Z, "pass"),
permutations, ...), ...)
Expand Down

0 comments on commit 47e9fc3

Please sign in to comment.