sample.test {PEkit} | R Documentation |
Lagrange Multiplier Test for
Description
Performs the Lagrange Multiplier test for the equality of the dispersion parameter of a sample.
The null hypothesis of the test is
, where
is given as input here.
Usage
sample.test(abund, psi = "a")
Arguments
abund |
An abundance vector of a sample. |
psi |
Target positive number |
Details
Calculates the Lagrange Multiplier test statistic
where is the log-likelihood function of
and
is its Fisher information.
The statistic
follows
-distribution with 1 degree of freedom
when the null hypothesis
is true.
Value
The statistic and a p-value of the two-sided test of the hypothesis.
References
Radhakrishna Rao, C, (1948), Large sample tests of statistical hypotheses concerning several parameters with applications to problems of estimation. Mathematical Proceedings of the Cambridge Philosophical Society, 44(1), 50-57. <doi: 10.1017/S0305004100023987>
Examples
## Test the psi of a sample from the Poisson-Dirichlet distribution:
set.seed(10000)
x<-rPD(1000, 10)
## Find the abundance of the data vector:
abund=abundance(x)
## Test for the psi that was used, as well as a higher and a lower one:
sample.test(abund, 10)
sample.test(abund, 15)
sample.test(abund, 5)
sample.test(abund) #test for psi=1
sample.test(abund, "r") #test for psi=n