Skip to contents

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

Usage

rtest(xtest, ...)

Arguments

xtest

an object used to select a method

...

further arguments passed to or from other methods; in plot.randtest to hist

Value

rtest returns an object of class randtest

Author

Daniel Chessel

Examples

par(mfrow = c(2, 2))
for (x0 in c(2.4, 3.4, 5.4, 20.4)) {
    l0 <- as.randtest(sim = rnorm(200), obs = x0)
    print(l0)
    plot(l0, main = paste("p.value = ", round(l0$pvalue, dig = 5)))
}
#> Monte-Carlo test
#> Call: as.randtest(sim = rnorm(200), obs = x0)
#> 
#> Observation: 2.4 
#> 
#> Based on 200 replicates
#> Simulated p-value: 0.004975124 
#> Alternative hypothesis: greater 
#> 
#>     Std.Obs Expectation    Variance 
#>  2.47394117 -0.02320398  0.95940331 

#> Monte-Carlo test
#> Call: as.randtest(sim = rnorm(200), obs = x0)
#> 
#> Observation: 3.4 
#> 
#> Based on 200 replicates
#> Simulated p-value: 0.009950249 
#> Alternative hypothesis: greater 
#> 
#>     Std.Obs Expectation    Variance 
#> 3.152515544 0.000212145 1.163025302 

#> Monte-Carlo test
#> Call: as.randtest(sim = rnorm(200), obs = x0)
#> 
#> Observation: 5.4 
#> 
#> Based on 200 replicates
#> Simulated p-value: 0.004975124 
#> Alternative hypothesis: greater 
#> 
#>     Std.Obs Expectation    Variance 
#>  5.46816486  0.05736036  0.95461569 

#> Monte-Carlo test
#> Call: as.randtest(sim = rnorm(200), obs = x0)
#> 
#> Observation: 20.4 
#> 
#> Based on 200 replicates
#> Simulated p-value: 0.004975124 
#> Alternative hypothesis: greater 
#> 
#>     Std.Obs Expectation    Variance 
#> 19.24850204 -0.07799822  1.13182981 

par(mfrow = c(1, 1))