check.zero.order.homog {cta} | R Documentation |
Z
Homogeneity Check
Checks whether the estimand function S(\cdot)
is zero-order Z
homogeneous.
check.zero.order.homog(S.fct, Z, tol = 1e-9)
S.fct |
An R function object, indicating the estimand function
|
Z |
Population (aka strata) matrix |
tol |
The pre-set tolerance with which |
The main idea:
S(\cdot)
is zero-order Z
homogeneous if S(Diag(Z\gamma) x) = S(x)
, for all \gamma > 0
, and for all x
within its domain. This program randomly generates gam
(\gamma
) and x
(x
), and computes
\texttt{diff.LRHS} = S(Diag(Z\gamma) x) - S(x).
It returns a warning if norm(diff.LRHS)
is too far from 0
.
check.zero.order.homog
returns a character string check.result
that states whether S(\cdot)
is zero-order Z
homogeneous. If check.result = ""
, it means that we cannot state that S(\cdot)
is not zero-order Z
homogeneous based on the result of the check.
Qiansheng Zhu
Lang, J. B. (2004) Multinomial-Poisson homogeneous models for contingency tables, Annals of Statistics, 32, 340–383.
# EXAMPLE 1
S.fct <- function(m) {(m[1] - m[2]) / (m[1] + m[2])}
Z <- matrix(c(1, 1, 1, 1), nrow = 4)
check.zero.order.homog(S.fct, Z)
# EXAMPLE 2
S.fct.2 <- function(m) {m[1] - m[2]}
Z <- matrix(c(1, 1, 1, 1), nrow = 4)
check.zero.order.homog(S.fct.2, Z)