Learn R Programming

SensitivityCaseControl (version 2.2)

gconv: Distribution of the convolution of two discrete random variables that taken on nonnegative integer values.

Description

Function finds the distribution for the convolution of two discrete random variables taking on nonnegative integer values.

Usage

gconv(g1, g2)

Arguments

g1

The probability that the first random variable takes on the values 0, 1, 2,...,maximum value.

g2

The probability that the second random variable takes on the values 0, 1, 2,..., maximum value.

Value

The probability that the convolution of the two random variables takes on the values 0, 1, 2,...,maximum value.

References

Section 2.3 of Small, D.S., Cheng, J., Halloran, M.E. and Rosenbaum, P.R. (2013). "Case Definition and Design Sensitivity." Journal of the American Statistical Association, 108, 1457-1468.

Examples

Run this code
# NOT RUN {
## For Gamma=3, I=3 discordant pairs and the Mantel-Haenszel statistic with d_i=1 for all i
gconv(gconv(c(1/4,3/4),c(1/4,3/4)),c(1/4,3/4))
## returns Pr(Tbar=k|m,F) for k=0,1,2,3)
# }

Run the code above in your browser using DataLab