Learn R Programming

smerc (version 1.8.3)

mc.pvalue: Compute Monte Carlo p-value

Description

mc.pvalue computes the Monte Carlo p-value of each element of tobs using the relationship (sum(tsim >= x) + 1)/(nsim + 1) where x is a specific element of tobs and nsim = length(tsim).

Usage

mc.pvalue(tobs, tsim)

Value

A vector of p-values.

Arguments

tobs

A vector observed test statistics

tsim

A vector of test statistics from simulated data

Examples

Run this code
mc.pvalue(8:10, 1:9)

Run the code above in your browser using DataLab