Learn R Programming

RecordTest (version 2.2.0)

.MonteCarlo: Monte Carlo Draws

Description

This function performs Monte Carlo simulations when needed, it is not developed for the use of the user.

Usage

.MonteCarlo(
  statistic,
  alternative,
  FUN,
  B = 1000,
  rdist = stats::runif,
  Trows,
  Mcols,
  ...
)

Value

Estimated p-value.

Arguments

statistic

Observed value of the statistic.

alternative

A character string indicating the alternative hypothesis and must be one of "greater", "less" or "two.sided".

FUN

A function that computes the statistic.

B

An integer specifying the number of replicates used in the Monte Carlo approach.

rdist

function that simulates continuous random variables, e.g., runif (fastest in stats package), rnorm or rexp.

Trows, Mcols

Number of rows and columns respectively, of the desired sample rdist.

...

Not used.

Author

Jorge Castillo-Mateo