cvmTest {cvmdisc}R Documentation

cvmTest

Description

Calculate test statistics for grouped data's counts and probabilities

Usage

cvmTest(counts, p, pave = FALSE)

Arguments

counts

vector containing the frequency of the counts in each group

p

vector of probabilities for counts, often called p-hat

pave

Logical. Set to be FALSE if the probabilities in groups are used; set to TRUE if the average of probabilities of groups j and j+1 are used

Details

cvmTest is used by groupFit to calculate test statistics for the fitted distributions.

Value

A list with the components:

Asq

Anderson-Darling test statistic

Wsq

Cramer-Von-Mises test statistic

Usq

Watson's test statistic

Chisq

Pearson's Chi-squared test statistic

Hj

Estimated cumulative probability

Author(s)

Shaun Zheng Sun and Dillon Duncan

See Also

groupFit: Data fitting function

Examples


#Choulakian, Lockhart and Stephens (1994)
counts <- c(10, 19, 18, 15, 11, 13, 7, 10, 13, 23, 15, 22)
phat <- rep(1/12, 12)

(stats1 <- cvmTest(counts, phat))

#Choulakian, Lockhart and Stephens (1994)
counts <- c(1 ,4 ,11 ,4 ,0)
phat <- c(0.05, 0.3, 0.3, 0.3, 0.05)

(stat2 <- cvmTest(counts, phat))

#Utilizing Benford's Law

#Setting pave to TRUE

#genomic data, Lesperance et al (2016)
genomic<- c(48, 14, 12, 6, 18, 5, 7, 8, 9)
phat<- log10(1+1/1:9)

(stat3 <- cvmTest(genomic, phat, pave = TRUE))


[Package cvmdisc version 0.1.0 Index]