power_calc_difference {truelies}R Documentation

Estimate power to detect differences in lying between two samples

Description

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

Usage

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


power_calc_difference(N1 = 100, P = 0.5, lambda = 0, lambda2 = 0.25)


[Package truelies version 0.2.0 Index]