power_calc: Calculate power to detect non-zero lying

Description Usage Arguments Value Examples

Description

This uses simulations to estimate the power to detect a given level of lying in a sample of size N by this package's methods.

Usage

1
2
power_calc(N, P, lambda, alpha = 0.05, prior = stats::dunif,
  nsims = 200)

Arguments

N

Total number in sample

P

Probability of bad outcome

lambda

Probability of a subject lying

alpha

Significance level to use for the null hypothesis

prior

Prior over lambda. A function which takes a vector of values between 0 and 1, and returns the probability density. The default is the uniform distribution.

nsims

Number of simulations to run

Value

Estimated power, a scalar between 0 and 1.

Examples

1
power_calc(N = 50, P = 0.5, lambda = 0.2)

truelies documentation built on Aug. 27, 2019, 1:02 a.m.