check.homog {cta} | R Documentation |
Homogeneity Check
Description
Checks whether the constraint function satisfies
a necessary condition for
homogeneity.
Usage
check.homog(h.fct, Z, tol = NULL)
Arguments
h.fct |
An R function object, indicating the constraint function
|
Z |
Population (aka strata) matrix |
tol |
The pre-set tolerance with which |
Details
The main idea:
is
homogeneous if
, where
is a diagonal matrix with
elements raised to some power.
As a check, if is homogeneous then
That is,
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 .
Value
check.homog
returns a character string chk
that states whether
is
homogeneous. If
chk = ""
, it means that based on the necessary condition, we cannot state that is not
homogeneous.
Author(s)
Joseph B. Lang
References
Lang, J. B. (2004) Multinomial-Poisson homogeneous models for contingency tables, Annals of Statistics, 32, 340–383.
See Also
check.zero.order.homog
, mph.fit
, check.HLP
Examples
# 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)