Learn R Programming

entropart (version 1.4-4)

SimTest: SimTest class

Description

Methods for objects of type "SimTest", used to test a value against its distribution under a simulated null hypothesis.

Usage

as.SimTest(RealValue, SimulatedValues)
is.SimTest(x)
## S3 method for class 'SimTest':
plot(x, Quantiles = c(0.025, 0.975), ...,
  colValue = "red",lwdValue = 2, ltyValue = 2,
  colQuantiles = "black", lwdQuantiles = 1, ltyQuantiles = 2)
## S3 method for class 'SimTest':
summary(object, Quantiles = c(0.025, 0.975), ...)

Arguments

RealValue
A numeric Value (the actual one).
SimulatedValues
A numeric vector containing the simulated values.
x
An object to be tested or plotted.
object
A SimTest object to be summarized.
Quantiles
A vector containing the quantiles of interest.
colValue
The color of the line representing the real value on the plot.
lwdValue
The width of the line representing the real value on the plot.
ltyValue
The line type of the line representing the real value on the plot.
colQuantiles
The color of the lines representing the quantiles on the plot.
lwdQuantiles
The width of the lines representing the quantiles on the plot.
ltyQuantiles
The line type of the lines representing the quantiles on the plot.
...
Additional arguments to be passed to the generic methods.

Value

  • SimTest objects are lists containing:
  • RealValueThe value to test.
  • SimulatedValuesA vector of simulated values, whose quantiles will be used for the test.
  • is.SimTest returns TRUE if the object is of class SimTest. summary.SimTest returns a summary of the object, including the empirical quantile of the real value in the simulated distributon.

Details

Simulated values should be obtained by simulation. The actual value is compared to simulated quantiles. SimTest objects can be plotted and summarized.

Examples

Run this code
# Set the value to test
Real <- 0.8
# Is it a realization of a Gaussian distribution?
Sims <- rnorm(1000)
# Make a Simtest object
st <- as.SimTest(Real, Sims)
plot(st)
summary(st)

Run the code above in your browser using DataLab