mult.sample.test {PEkit}R Documentation

Test for ψ\psi of multiple samples

Description

Likelihood ratio test for the hypotheses H0:ψ1=ψ2=...=ψdH_0: \: \psi_1=\psi_2=...=\psi_d and H1:ψ1ψ2...ψdH_1: \: \psi_1 \neq \psi_2 \neq ... \neq \psi_d, where ψ1,ψ2,\psi_1,\psi_2,...,ψd,\psi_d are the dispersal parameters of the dd samples in the columns of the input data array x.

Usage

mult.sample.test(x)

Arguments

x

The data array to be tested. Each column of x is an independent sample.

Details

Calculates the Likelihood Ratio Test statistic

2log(L(ψ^)/L(ψ^1,ψ^2,...,ψ^d)),-2log(L(\hat{\psi})/L(\hat{\psi}_1, \hat{\psi}_2, ..., \hat{\psi}_d)),

where L is the likelihood function of observing the dd input samples given a single ψ\psi in the numerator and dd different parameters ψ1,ψ2,\psi_1,\psi_2,...,ψd,\psi_d for each sample respectively in the denominator. According to the theory of Likelihood Ratio Tests, this statistic converges in distribution to a χd12\chi_{d-1}^2-distribution when the null-hypothesis is true, where d1d-1 is the difference in the amount of parameters between the considered models. To calculate the statistic, the Maximum Likelihood Estimate for ψ1,ψ2,...,ψd\psi_1,\: \psi_2,\: ..., \: \psi_d of H1H_1 and the shared ψ\psi of H0H_0 are calculated.

Value

Gives a vector with the Likelihood Ratio Test -statistic Lambda, as well as the p-value of the test p.

References

Neyman, J., & Pearson, E. S. (1933). On the problem of the most efficient tests of statistical hypotheses. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical Or Physical Character, 231(694-706), 289-337. <doi: 10.1098/rsta.1933.0009>.

Examples

##Create samples with different n and psi:
set.seed(111)
x<-rPD(1200, 15)
y<-c( rPD(1000, 20), rep(NA, 200) )
z<-c( rPD(800, 30), rep(NA, 400) )
samples<-cbind(cbind(x, y), z)
##Run test
mult.sample.test(samples)

[Package PEkit version 1.0.0.1000 Index]