symmet.test.lsd {LSDsensitivity} | R Documentation |
Unimodality and symmetry tests
Description
Perform a set of unimodality and symmetry tests useful for simulation model data from a Monte Carlo experiment distributions. The included tests are: Hartigans dip test for unimodality (Hdip), and the Cabilio and Masaro (CM), the Mira (M), and the Miao, Gel and Gastwirth tests for symmetry.
Usage
symmet.test.lsd( data, vars = dimnames( data )[[ 2 ]], start.period = 0,
signif = 0.05, digits = 2, sym.boot = FALSE )
Arguments
data |
a three-dimensional array, as the ones produced by |
vars |
a vector of the variable names (as strings) contained in |
start.period |
integer: the first time step in |
signif |
numeric in [0, 1]: statistical significance to evaluate the tests rejection of the null-hypothesis. The default value is 0.05 (5%). |
digits |
integer: the number of significant digits to show in results. The default is 2. |
sym.boot |
logical: set to |
Details
This function is a wrapper to the functions dip.test
in diptest
package, and symmetry.test
in lawstat
package.
Value
The function returns a data frame presenting both the average test statistics and the frequency of test null-hypothesis rejections for all the variables selected in vars
.
Null hypothesis (H0) for Hdip test is an unimodal distribution for the Monte Carlo distribution. Null hypothesis (H0) for CM, M and MGG tests is a symmetric distribution for the Monte Carlo distribution.
Author(s)
NA
See Also
list.files.lsd()
, read.3d.lsd()
in LSDinterface-package
,
dip.test()
, symmetry.test()
Examples
# get the list of file names of example LSD results
library( LSDinterface )
files <- list.files.lsd( system.file( "extdata", package = "LSDsensitivity" ),
"Sim1.lsd", recursive = TRUE )
# Steps to use this function:
# 1. load data from a LSD simulation saved results using a read.xxx.lsd
# function from LSDinterface package (read.3d.lsd, for instance)
# 2. use symmet.test.lsd to apply the tests on the relevant variables,
# replacing "var1", "var2" etc. with your data
# read data from Monte Carlo runs
dataSet <- read.3d.lsd( files )
# apply tests
tests <- symmet.test.lsd( dataSet, # the data set to use
c( "var2", "var3" ), # the variables to test
signif = 0.01, # use 1% significance
digits = 4, # show results using 4 digits
sym.boot = FALSE ) # use bootstrap for precision
print( tests )