RT1SAMP | R Documentation |
RT1SAMP carries out the Fisher randomization test or the paired comparison randomization test. The permutational one-sample randomization test does not require normality of the distribution. A randomization confidence interval for the mean can also be determined.
RT1SAMP( x, mu = 0, NRAND = 4999, alt = "two", complete = FALSE, CI = FALSE, silent = FALSE, seed = NULL )
x |
a (non-empty) numeric vector of data values. |
mu |
an scalar; it is the value of |
NRAND |
numeric; the number of randomizations (permutations). It is
ignored when |
alt |
a character string specifying the alternative hypothesis, must
be one of " |
complete |
a logical variable; when |
CI |
a logical variable indicating whether approximate 95\
randomization confidence intervals will be calculated ( |
silent |
a logical variable indicating whether calculation results are
printed to the R console ( |
seed |
a single value, interpreted as an integer, or |
The procedure (1) calculates the mean scores for the difference between the
observed data x
and the value of mu under the null hypothesis
mu
. The user has the option to enumerate all possible randomizations
or to sample the randomization distribution. In this latter case, the
function sampleRD
is invoked. In addition, it is possible to
produce an approximate 95% / 99% confidence interval by interpolation
(useful for simulations). If confidence limits are needed, the number of
randomizations should be a large enough number (probably 4999 or more). The
upper percentage points (percentages of randomization differences greater
than or equal to the observed x - mu
means) can be determined for a
range of trial values for L and U, which, when subtracted from the x
,
just avoid giving a significant difference between the two sample means. The
upper percentage points (percentages of randomization differences greater
than or equal to the observed difference between x
and mu
) can
be determined for a range of trial values for L, and linear interpolation is
used to determine the value of L to be substracted from the x
measurements producing a difference between x
and mu
that is
on the borderline of being significantly large at about the 2.5\
level. Analogously, the lower percentage points (the percentages of
randomization differences less than or equal to the observed difference
x - mu
can be determined for some trial values of U. Again, linear
interpolation is used to determine the value of U to be substracted from the
x - mu
measurements producing a difference that is on the borderline
of being significantly small at about the 2.5\
seed
is a way to call the set.seed
function,
"the recommended way to specify seeds" in random number generation.
The function summary.RT
is used to obtain and print a summary of the
results, and a plot.RT
method is available for displaying the
randomization distribution of mean differences.
The function returns a RT
result object (list)
Jorge Navarro-Alberto
Manly, B.F.J. and Navarro-Alberto, J.A. (2021) Randomization, Bootstrap and Monte Carlo Methods in Biology. 4th Edition. Chapman and Hall/ CRC Press.
sampleRD
, count
,
summary.RT
and the main plotting function
plot.RT
# Example in Manly and Navarro Alberto (2021), Section 1.5 Dif <- cornheight[,"Cross"] - cornheight[,"Self"] corn1s.c <- RT1SAMP(Dif, complete=TRUE) # Complete enumerations # corn1s.s <- RT1SAMP(Dif, CI=TRUE) # Sampled distribution, CI for x - mu.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.