View source: R/upsilon.gof.test.R
| upsilon.gof.test | R Documentation |
(FOR INTERNAL USE ONLY) Performs the Upsilon Goodness-of-Fit test to determine if a sample of observed counts fits a specified probability distribution. The Upsilon statistic uses a specific normalization (dividing by the average expected count) which differs from the standard Pearson's Chi-squared test.
upsilon.gof.test(
x,
p = rep(1/length(x), length(x)),
rescale.p = TRUE,
log.p = FALSE
)
x |
A numeric vector representing observed counts. Must be non-negative. |
p |
A numeric vector of probabilities of the same length as |
rescale.p |
Logical. If |
log.p |
a logical. If |
A list with class "htest" containing:
statistic |
The Upsilon test statistic. |
parameter |
The degrees of freedom (k - 1). |
p.value |
The p-value of the test. |
estimate |
The effect size. |
method |
A character string indicating the method used. |
data.name |
A character string giving the name(s) of the data. |
observed |
The observed counts. |
expected |
The expected counts. |
residuals |
The Pearson residuals. |
p.normalized |
The probability vector used (after rescaling if applicable). |
library("Upsilon")
# Test against uniform distribution
counts <- c(10, 20, 30)
upsilon.gof.test(counts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.