mult.sample.test: Test for psi of multiple samples

Description Usage Arguments Details Value References Examples

View source: R/Parameter_estimation_and_hypothesis_testing.R

Description

Likelihood ratio test for the hypotheses H_0: \: ψ_1=ψ_2=...=ψ_d and H_1: \: ψ_1 \neq ψ_2 \neq ... \neq ψ_d, where ψ_1,ψ_2,...,ψ_d are the dispersal parameters of the d samples in the columns of the input data array x.

Usage

1

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(\hat{ψ})/L(\hat{ψ}_1, \hat{ψ}_2, ..., \hat{ψ}_d)),

where L is the likelihood function of observing the d input samples given a single ψ in the numerator and d different parameters ψ_1,ψ_2,...,ψ_d for each sample respectively in the denominator. According to the theory of Likelihood Ratio Tests, this statistic converges in distribution to a χ_{d-1}^2-distribution when the null-hypothesis is true, where d-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 of H_1 and the shared ψ of H_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

1
2
3
4
5
6
7
8
##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)

PEkit documentation built on Nov. 22, 2021, 9:08 a.m.