fisher_pv | R Documentation |
Compute the p-value of a Fisher randomization test.
fisher_pv(value, group, Tfun, nsim = 1000, strict = TRUE)
value |
Vector of length |
group |
Vector of length |
Tfun |
Function taking vector arguments |
nsim |
Number of randomizations to perform. |
strict |
Whether the p-value is "strictly greater" or just "greater than or equal" (see 'Details'). |
Suppose there is only one test statistic ntest = 1
. Then the Fisher randomization test calculates
Pr(Tsim > Tobs),
where Tobs = Tfun(value, group)
is the observed value of the test statistic, and Tsim = Tfun(value[irand], group)
, where irand
is a random permutation of the nobs
observations. When ntest > 1
, fisher_pv()
performs the calculation above for each test statistic.
When strict = FALSE
the p-value is Pr(Tsim >= Tobs)
.
A two column matrix with ntest
rows and columns:
Tobs
A vector of length ntest
, where Tobs[t]
is the observed value of test statistic t
.
pval
A vector of ntest
p-values of the form Pr(Tsim[t] > Tobs[t])
, where Tobs[t] = Tfun(value, group)[t]
and Tsim[t]
is computed by randomly reallocating value
to the given vector group
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.