Model.BCBinProb {BinaryEPPM} R Documentation

## Probabilities for beta and correlated binomial distributions given p's and scale-factors.

### Description

Calculates the probabilities for beta and correlated binomials given values for p's and scale-factors.

### Usage

```Model.BCBinProb(parameter, model.type, model.name, link, ntrials, covariates.matrix.p,
covariates.matrix.scalef = matrix(c(rep(1, nrow(covariates.matrix.p))), ncol = 1),
offset.p = c(rep(0, length(ntrials))), offset.scalef = c(rep(0, length(ntrials))))
```

### Arguments

 `parameter` A vector of the parameters of the model which is set to initial estimates on function call. `model.type` Takes one of two values i.e. 'p only' or 'p and scale-factor'. The 'p only' value fits a linear predictor function to the parameter p which is the 'm(1)' in equation (6) of Faddy and Smith (2012) divided by 'N'. The 'p and scale-factor' value fits linear predictor functions to both p and the scale-factor. `model.name` The model being fitted is one of the two 'beta binomial' or 'correlated binomial'. `link` Takes one of nine values i.e., 'logit', 'probit', 'cloglog', 'cauchit', 'log', 'loglog', 'double exponential', 'double reciprocal', 'power logit'. The default is 'cloglog'. The 'power logit' has an attribute of 'power' for which the default is 1 i.e., a logit link. `ntrials` This is a scalar representing the denominator i.e., the length of the probability mass function returned is this scalar + 1. `covariates.matrix.p` A matrix of covariates for p where rows are the number of values in listbinary and columns the covariates. This matrix is extracted from the formulae in function BinaryEPPM. However, in the accompanying example it is shown how it can be constructed independently of function BinaryEPPM. `covariates.matrix.scalef` A matrix of covariates for the scale-factor where rows are the number of values in listbinary and columns the covariates. The default is a vector of ones. This matrix is extracted from the formulae in function BinaryEPPM. However, in the accompanying example it is shown how it can be constructed independently of function BinaryEPPM. `offset.p` An offset vector for p. The default is a vector of ones. `offset.scalef` An offset vector for the scale-factor. The default is a vector of ones.

### Value

List of arguments input together with a list of probabilities vectors and a data frame of values of p, theta (beta binomial) or rho (correlated binomial) and the limits for theta or rho.

 `model` The model is either 'beta binomial' or 'correlated binomial'. `link` The link is either 'logit' or 'cloglog'. `parameter` A vector of the parameters of the model which is set to initial estimates on function call. `probabilities` A list of the vectors of probabilities of the model. `probabilities` A data frame of values of p, theta (beta binomial) or rho (correlated binomial) and the limits for theta or rho.

### Author(s)

David M. Smith <smithdm1@us.ibm.com>

### References

Hughes G, Madden L (1995). Some methods allowing for aggregated patterns of disease incidence in the analysis of data from designed experiments. Plant Pathology, 44, 927-943.

Kupper L, Haseman J (1978). The use of a correlated binomial model for the analysis of toxicological epxeriments. Biometrics, 34(1), 69-76.

Williams D (1996). Overdispersion in logistic linear models. In B Morgan (ed.), Statistics in Toxicology, 75-84. Oxford Science Publications.

### Examples

```link <- 'cloglog'