bayesPoisTest: Bayesian two-sample test of Poisson rates

Description Usage Arguments See Also Examples

Description

Bayesian two-sample test of Poisson rates

Usage

1
2
bayesPoisTest(x, t, a1, b1, a2, b2, a = a1, b = b1, pi0 = 0.5,
  pi1 = 1 - pi0, c = 1, rule = c * pi1/pi0)

Arguments

x

two-vector containing occurrences

t

duration of trials (the same for both samples)

a1

alpha, the hyperparameter of the gamma distribution of the first poisson rate

b1

beta, the hyperparameter of the gamma distribution of the first poisson rate

a2

alpha, the hyperparameter of the gamma distribution of the second poisson rate

b2

beta, the hyperparameter of the gamma distribution of the second poisson rate

a

alpha, the hyperparameter of the gamma distribution under the null

b

beta, the hyperparameter of the gamma distribution under the null

pi0

the prior probability of the null hypothesis

pi1

the prior probability of the alternative hypothesis

c

relative loss constant (loss due to type II error divided by loss due to type I error)

rule

the decision rule for the Bayes factor B. by default, test rejects when B < pi1/pi0 * c2/c1

See Also

samplePower, samplePowerEst, findSize

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

a1 <- 5; b1 <- .2 # E = 1
a2 <- 30; b2 <- .167 # E = 5
plotGamma(c(a1, a2), c(b1, b2))
bayesPoisTest(c(18, 105), 20, a1, b1, a2, b2)
bayesPoisTest(c(18, 165), 20, a1, b1, a2, b2)

# compare to :
prop.test(c(10, 16), c(20, 20))


 
## End(Not run)

dkahle/bayesRates documentation built on May 15, 2019, 9:07 a.m.