discreteT | R Documentation |
Computes the test statistics introduced in \insertCiteBB2025DRPT;textualDRPT for settings where the data support is discrete and finite.
discreteT(NX, NY, r, n, m, type = "V")
NX |
A vector of counts for the first sample.
This corresponds to the sequence |
NY |
A vector of counts for the second sample.
This corresponds to the sequence |
r |
A numeric vector of positive values specifying the hypothesised density ratio in the discrete setting. |
n |
The size of the first sample. |
m |
The size of the second sample. |
type |
A character string indicating which test statistic to compute.
One of |
When type = "U"
, the U-statistic (12) is calculated.
When type = "V"
, the V-statistic (11) is computed.
When type = "D"
, the test statistic (56) from Appendix B is returned.
A numeric value representing the computed test statistic.
BB2025DRPTDRPT
n = 100; m = n
X = sample(0:3, n, prob = c(1/4, 1/4, 1/4, 1/4), replace = TRUE)
Y = sample(0:3, m, prob = c(1/17, 3/17, 3/17, 10/17), replace = TRUE)
r = c(1, 3, 3, 10)
NX = table(X)
NY = table(Y)
discreteT(NX, NY, r, sum(NX), sum(NY), type = "V")
discreteT(NX, NY, r, sum(NX), sum(NY), type = "D")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.