rtest {ade4}R Documentation

Class of the Permutation Tests (in R).

Description

rtest is a generic function. It proposes methods for the following objects between, discrimin, procuste ...

Usage

    rtest(xtest, ...)
    ## S3 method for class 'rtest':
plot(x, nclass = 10, coeff = 1, ...)
    as.rtest (sim, obs, call = match.call())
    ## S3 method for class 'rtest':
print(x, ...)

Arguments

xtest an object used to select a method
x an object of class 'rtest'
... further arguments passed to or from other methods; in plot.randtest to hist
nclass a number of intervals for the histogram
coeff to fit the magnitude of the graph
sim a numeric vector of simulated values
obs a numeric vector of an observed value
call a call order

Value

as.rtest returns a list of class rtest
plot.rtest draws the simulated values histograms and the position of the observed value

Author(s)

Daniel Chessel

See Also

RV.rtest, mantel.rtest, procuste.rtest, randtest

Examples

par(mfrow = c(2,2))
for (x0 in c(2.4,3.4,5.4,20.4)) {
    l0 <- as.rtest(sim = rnorm(200), obs = x0)
    print(l0)
    plot(l0,main=paste("p.value = ", round(l0$pvalue, dig = 5)))
}

Worked out examples


> library(ade4)
> ### Name: rtest
> ### Title: Class of the Permutation Tests (in R).
> ### Aliases: rtest as.rtest plot.rtest print.rtest
> ### Keywords: methods
> 
> ### ** Examples
> 
> par(mfrow = c(2,2))
> for (x0 in c(2.4,3.4,5.4,20.4)) {
+     l0 <- as.rtest(sim = rnorm(200), obs = x0)
+     print(l0)
+     plot(l0,main=paste("p.value = ", round(l0$pvalue, dig = 5)))
+ }
Monte-Carlo test
Observation: 2.4 
Call: as.rtest(sim = rnorm(200), obs = x0)
Based on 200 replicates
Simulated p-value: 0.009950249 
Monte-Carlo test
Observation: 3.4 
Call: as.rtest(sim = rnorm(200), obs = x0)
Based on 200 replicates
Simulated p-value: 0.009950249 
Monte-Carlo test
Observation: 5.4 
Call: as.rtest(sim = rnorm(200), obs = x0)
Based on 200 replicates
Simulated p-value: 0.004975124 
Monte-Carlo test
Observation: 20.4 
Call: as.rtest(sim = rnorm(200), obs = x0)
Based on 200 replicates
Simulated p-value: 0.004975124 
> 
> 
> 
> 

[Package ade4 Index]