pdf {CorrBin} R Documentation

## Parametric distributions for correlated binary data

### Description

qpower.pdf and betabin.pdf calculate the probability distribution function for the number of responses in a cluster of the q-power and beta-binomial distributions, respectively.

### Usage

betabin.pdf(p, rho, n)

qpower.pdf(p, rho, n)


### Arguments

 p numeric, the probability of success. rho numeric between 0 and 1 inclusive, the within-cluster correlation. n integer, cluster size.

### Details

The pdf of the q-power distribution is

P(X=x) = {{n}\choose{x}}\sum_{k=0}^x (-1)^k{{x}\choose{k}}q^{(n-x+k)^\gamma},

x=0,\ldots,n, where q=1-p, and the intra-cluster correlation

\rho = \frac{q^{2^\gamma}-q^2}{q(1-q)}.

The pdf of the beta-binomial distribution is

P(X=x) = {{n}\choose{x}} \frac{B(\alpha+x, n+\beta-x)}{B(\alpha,\beta)},

x=0,\ldots,n, where \alpha= p\frac{1-\rho}{\rho}, and \alpha= (1-p)\frac{1-\rho}{\rho}.

### Value

a numeric vector of length n+1 giving the value of P(X=x) for x=0,\ldots,n.

### Author(s)

Aniko Szabo, aszabo@mcw.edu

### References

Kuk, A. A (2004) Litter-based approach to risk assessment in developmental toxicity studies via a power family of completely monotone functions Applied Statistics, 52, 51-61.

Williams, D. A. (1975) The Analysis of Binary Responses from Toxicological Experiments Involving Reproduction and Teratogenicity Biometrics, 31, 949-952.

ran.CBData for generating an entire dataset using these functions

### Examples


#the distributions have quite different shapes
#with q-power assigning more weight to the "all affected" event than other distributions
plot(0:10, betabin.pdf(0.3, 0.4, 10), type="o", ylim=c(0,0.34),
ylab="Density", xlab="Number of responses out of 10")
lines(0:10, qpower.pdf(0.3, 0.4, 10), type="o", col="red")



[Package CorrBin version 1.6.1 Index]