Title: | An Implementation of the Bridge Distribution with Logit-Link as in Wang and Louis (2003) |
---|---|
Description: | An implementation of the bridge distribution with logit-link in R. In Wang and Louis (2003) <DOI:10.1093/biomet/90.4.765>, such a univariate bridge distribution was derived as the distribution of the random intercept that 'bridged' a marginal logistic regression and a conditional logistic regression. The conditional and marginal regression coefficients are a scalar multiple of each other. Such is not the case if the random intercept distribution was Gaussian. |
Authors: | Bruce Swihart [aut, cre] |
Maintainer: | Bruce Swihart <[email protected]> |
License: | GPL (>=2) |
Version: | 0.1.3 |
Built: | 2025-01-17 03:36:57 UTC |
Source: | https://github.com/swihart/bridgedist |
Density, distribution function, quantile function and random generation for
the bridge distribution with parameter phi
. See Wang and Louis (2003).
dbridge(x, phi = 1/2, log = FALSE) pbridge(q, phi = 1/2, lower.tail = TRUE, log.p = FALSE) qbridge(p, phi = 1/2, lower.tail = TRUE, log.p = FALSE) rbridge(n, phi = 1/2)
dbridge(x, phi = 1/2, log = FALSE) pbridge(q, phi = 1/2, lower.tail = TRUE, log.p = FALSE) qbridge(p, phi = 1/2, lower.tail = TRUE, log.p = FALSE) rbridge(n, phi = 1/2)
x , q
|
vector of quantiles. |
phi |
phi parameter. The phi must be between 0 and 1. A phi of 1/sqrt(1+3/pi^2) gives unit variance. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
If phi
is omitted, the default
value 1/2
is assumed.
The Bridge distribution parameterized by
phi
has distribution function
and density
The mean is and the variance is
.
dbridge
gives the density, pbridge
gives the
distribution function, qbridge
gives the quantile function, and
rbridge
generates random deviates.
The length of the result is determined by n
for rbridge
, and
is the maximum of the lengths of the numerical arguments for the other
functions.
The numerical arguments other than n
are recycled to the length of
the result. Only the first elements of the logical arguments are used.
Consult the vignette for some figures comparing the normal, logistic, and bridge distributions.
[dpq]bridge
are calculated directly from the definitions.
rbridge
uses inversion.
Wang, Z. and Louis, T.A. (2003) Matching conditional and marginal shapes in binary random intercept models using a bridge distribution function. Biometrika, 90(4), 765-775. <DOI:10.1093/biomet/90.4.765>
See also:
Swihart, B.J., Caffo, B.S., and Crainiceanu, C.M. (2013). A Unifying Framework for Marginalized Random-Intercept Models of Correlated Binary Outcomes. International Statistical Review, 82 (2), 275-295 1-22. <DOI: 10.1111/insr.12035>
Griswold, M.E., Swihart, B.J., Caffo, B.S and Zeger, S.L. (2013). Practical marginalized multilevel models. Stat, 2(1), 129-142. <DOI: 10.1002/sta4.22>
Heagerty, P.J. (1999). Marginally specified logistic-normal models for longitudinal binary data. Biometrics, 55(3), 688-698. <DOI: 10.1111/j.0006-341X.1999.00688.x>
Heagerty, P.J. and Zeger, S.L. (2000). Marginalized multilevel models and likelihood inference (with comments and a rejoinder by the authors). Stat. Sci., 15(1), 1-26. <DOI: 10.1214/ss/1009212671>
Distributions for other standard distributions.
## Confirm unit variance for phi = 1/sqrt(1+3/pi^2) var(rbridge(1e5, phi = 1/sqrt(1+3/pi^2))) # approximately 1
## Confirm unit variance for phi = 1/sqrt(1+3/pi^2) var(rbridge(1e5, phi = 1/sqrt(1+3/pi^2))) # approximately 1