emp2pval {bayesclust} | R Documentation |
emp2pval
converts the Empirical Posterior Probability (EPP) computed by
cluster.test
into a frequentist p-value, which can then be used to
assess the significance of the alternative hypothesis.
emp2pval(x, y, ignore = FALSE)
x |
x is an object of class ``cluster.test'', which is returned
when cluster.test is run on a dataset. |
y |
y is an object of class ``nulldensity'', which is returned when
nulldensity is run with the necessary parameters provided. |
ignore |
ignore is a logical variable which specifies whether the parameters
in x and y should be matched for consistency. |
If ignore
is set to FALSE, then the routine will first check to see if the
parameters under which the test was run match exactly with the parameters under which
the null distribution was generated. If they were, then the EPP's in the ``cluster.test''
object will be converted to a frequentist p-value by checking the ``nulldensity'' object to
see which empirical quantile they fall in. If ignore
is set to TRUE, the same EPP to
p-value conversion is carried out, but this time without the preliminary check on the parameters.
When several ``emp2pval'' objects are created, i.e., when several datasets are to be tested
or when multiple tests are carried out on a single dataset, they can all be fed into
fdr.test
to assess which tests are significant, while controlling the False Discovery Rate (FDR).
emp2pval
returns a list comprising 2 components.
param |
This component is a copy of the parameters used when running cluster.test
on the dataset. In the case that emp2pval was run with ignore set to TRUE, then
this could potentially be different than the parameters under which the nulldensity object
was generated. |
pvals |
A dataframe with the EPP of the dataset and the corresponding frequentist p-values. |
Gopal, V.
Fuentes, C. and Casella, G. (2008) "Testing for the Existence of Clusters" http://www.stat.ufl.edu/~casella/Papers/paper-v3.pdf
Gopal, V. "BayesClust User Manual" http://www.stat.ufl.edu/~viknesh/bayesclust/clust.html
cluster.test
for information on objects of class ``cluster.test''.
nulldensity
for information on objects of class ``nulldensity''.
# Generate random 2-variate data Y <- matrix(rnorm(24), nrow=12) # Search for optimal partitioning of data into 2 clusters test1 <- cluster.test(Y, p=2) # Generate corresponding null density object. null1 <- nulldensity(nsim=100, n=12, p=2, k=2) # Convert EPP to p-value emp2pval(test1, null1)