| balance | R Documentation |
Sometimes a hyper2 object is unbalanced in the sense that its
powers do not sum to zero. This is rectified by balance(), which
modifies the power of the bracket corresponding to the sum of all pnames
accordingly.
balance(H)
H |
object of class |
This is just a convenience function, all it does is
H[pnames(H)] <- 0
H[pnames(H)] <- -sum(pnames(H))
H
(the first line ensures that H[pnames(H)] is over-written
correctly by the second). Package vignette zeropower discusses
the zero power sum condition: in particular, note that loglik()
throws an error if its likelihood function does not satisfy the
zero-sum-power condition.
Returns a balanced hyper2 object
Robin K. S. Hankin
print.hyper2, balance
H <- hyper2()
H["a"] <- 6
H["b"] <- 3
H[c("a","c")] <- 7
H <- balance(H)
maxp(H)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.