getSimulationPvalue: Function to calculate simulations-based p-values

Description Usage Arguments Details Value Examples

Description

Function to calculate simulations-based p-values

Usage

1
2
getSimulationPvalue(observedVal, simulatedVals, direction = "greater",
  checkArgs = FALSE)

Arguments

observedVal

observed statistic (single number)

simulatedVals

statistics observed in simulations of the outcomes based on assumed null distribution.

direction

one of 'greater' or 'less', depending on the nature of statistic.

checkArgs

single boolean specifying whether arguments should be checked for adherence to specifications. DEFAULT: FALSE

Details

this function calculates fraction of simulated values (statistics from null distribution) that are >= (direction='greater') or <= (direction='less') than the observed statistic. The choice of direction depends on the nature of the statistic (i.e., direction is 'greater' if large values of statistic indicate departure from null hypothesis, and direction is 'less' if the opposite is the case)

Value

a fraction of simulated statistics that are as or more extreme as the observed one

Examples

1
2
MBASED:::getSimulationPvalue(observedVal=2, simulatedVals=1:10, direction='greater')
MBASED:::getSimulationPvalue(observedVal=2, simulatedVals=1:10, direction='less')

MBASED documentation built on Nov. 8, 2020, 5:53 p.m.