Description Usage Arguments Details Value Author(s) References See Also Examples
Checks whether the constraint function h(\cdot) satisfies a necessary condition for Z homogeneity.
1 | check.homog(h.fct, Z, tol = NULL)
|
h.fct |
An R function object, indicating the constraint function h(\cdot) for Z homogeneity check. |
Z |
Population (aka strata) matrix Z. |
tol |
The pre-set tolerance with which |
The main idea:
h(\cdot) is Z homogeneous if h(Diag(Zγ)x) = G(γ)h(x), where G is a diagonal matrix with γ elements raised to some power.
As a check, if h(\cdot) is homogeneous then
h(Diag(Zγ) x_{1}) / h(Diag(Zγ) x_{2}) = h(x_{1}) / h(x_{2});
That is,
\texttt{diff} = h(Diag(Zγ) x_{1}) h(x_{2}) - h(Diag(Zγ) x_{2}) h(x_{1}) = 0.
Here, the division and multiplication are taken element-wise.
This program randomly generates gamma
, x1
, and x2
, and
computes norm(diff)
. It returns a warning if norm(diff)
is
too far from 0.
check.homog
returns a character string chk
that states whether
h(\cdot) is Z homogeneous. If chk = ""
, it means that based on the necessary condition, we cannot state that h(\cdot) is not Z homogeneous.
Joseph B. Lang
Lang, J. B. (2004) Multinomial-Poisson homogeneous models for contingency tables, Annals of Statistics, 32, 340–383.
check.zero.order.homog
, mph.fit
, check.HLP
1 2 3 4 5 6 7 8 9 | # EXAMPLE 1
h.fct <- function(m) {m[1] - m[2]}
Z <- matrix(c(1, 1), nrow = 2)
check.homog(h.fct, Z)
# EXAMPLE 2
h.fct.2 <- function(m) {m[1]^2 - m[2]}
Z <- matrix(c(1, 1), nrow = 2)
check.homog(h.fct.2, Z)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.