View source: R/Parameter_estimation_and_hypothesis_testing.R
sample.test | R Documentation |
\psi
Performs the Lagrange Multiplier test for the equality of the dispersion parameter \psi
of a sample.
The null hypothesis of the test is H_0: \psi = \psi_0
, where \psi_0
is given as input here.
sample.test(abund, psi = "a")
abund |
An abundance vector of a sample. |
psi |
Target positive number |
Calculates the Lagrange Multiplier test statistic
S\, = \,U(\psi_0)^2 / I(\psi_0),
where U
is the log-likelihood function of \psi
and I
is its Fisher information.
The statistic S
follows \chi^2
-distribution with 1 degree of freedom
when the null hypothesis H_0:\psi=\psi_0
is true.
The statistic S
and a p-value of the two-sided test of the hypothesis.
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. <\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/S0305004100023987")}>
## 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.