size2.samevar {emon} | R Documentation |
Calculates the Negative Binomial size parameter s2
such that the variance of the distribution
with mean mu2
and size s2
is the same as the Negative Binomial distribution with mean
mu1
and size s1
. This can be useful when computing power for a Negative Binomial
distribution in the packages power.groups
and power.BACI
.
size2.samevar(mu1, mu2, s1)
mu1 |
Negative Binomial mean for group 1 |
mu2 |
Negative Binomial mean for group 2 |
s1 |
Negative Binomial size for group 1 |
The size for group 1.
Jon Barry: Jon.Barry@cefas.co.uk
mu1=5; mu2=10; s1=3
s2 = size2.samevar(mu1, mu2, s1)
s2
# Check variances are the same
v1 = mu1 + mu1^2 / s1
v2 = mu2 + mu2^2 / s2
v1; v2