size2.samevar: Calculates negative binomial size to preserve constant...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/twogroups.r

Description

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.

Usage

1
size2.samevar(mu1, mu2, s1)

Arguments

mu1

Negative Binomial mean for group 1

mu2

Negative Binomial mean for group 2

s1

Negative Binomial size for group 1

Value

The size for group 1.

Author(s)

Jon Barry: Jon.Barry@cefas.co.uk

See Also

power.groups, power.BACI

Examples

1
2
3
4
5
6
7
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

emon documentation built on May 2, 2019, 10:21 a.m.