Learn R Programming

robust2sls (version 0.2.2)

test_cpv: Critical and p-value for test statistic relative to simulated distribution

Description

test_cpv returns the critical value corresponding to a given quantile of the simulated distribution and the p-value of the test statistic.

Usage

test_cpv(dist, teststat, p)

Value

A list with two named entries. $pval is the p-value of the test statistic with respect to the distribution dist. $q is the vector of sample quantiles in the distribution dist corresponding to the probabilities specified in p.

Arguments

dist

A numeric vector of simulated values approximating the distribution of the test statistic, e.g. generated as in mvn_sup().

teststat

A numeric value of the test statistic.

p

A numeric vector of probabilities with values in [0,1] for which the corresponding quantiles are calculated.