LRT.stat {MADPop} | R Documentation |
Likelihood ratio test statistic for contingency tables
Description
Calculate the likelihood ratio test statistic for general two-way contingency tables.
Usage
LRT.stat(tab)
Arguments
tab |
A |
Details
Suppose that tab
consists of counts from populations (rows) in
categories. The likelihood ratio test statistic is computed as
where is the observed number of counts in the
th row and
th column of
tab
, is the unconstrained estimate of the proportion of category
in population
, and
is the estimate of this proportion under
that the populations have indentical proportions in each category. If any column has only zeros it is removed before calculating the LRT statistic.
Value
The calculated value of the LRT statistic.
Examples
# simple contingency table
ctab <- rbind(pop1 = c(5, 3, 0, 3),
pop2 = c(4, 10, 2, 5))
colnames(ctab) <- LETTERS[1:4]
ctab
LRT.stat(ctab) # likelihood ratio statistic
[Package MADPop version 1.1.7 Index]