power_calc_difference: Estimate power to detect differences in lying between two...

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Using simulations, estimate power to detect differences in lying using compare_dists(), given values for λ, the probability of lying, in each sample.

Usage

1
2
3
power_calc_difference(N1, N2 = N1, P, lambda1, lambda2, alpha = 0.05,
  alternative = c("two.sided", "greater", "less"),
  prior = stats::dunif, nsims = 200)

Arguments

N1

N of sample 1

N2

N of sample 2

P

Probability of bad outcome

lambda1

Probability of lying in sample 1

lambda2

Probability of lying in sample 2

alpha

Significance level

alternative

"two.sided", "greater" (sample 1 is greater), or "less". Can be abbreviated

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_difference(N1 = 100, P = 0.5, lambda = 0, lambda2 = 0.25)

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