margmodel {weightedScores} | R Documentation |
DENSITY AND CDF OF THE UNIVARIATE MARGINAL DISTRIBUTION
Description
Density and cdf of the univariate marginal distribution.
Usage
dmargmodel(y,mu,gam,invgam,margmodel)
pmargmodel(y,mu,gam,invgam,margmodel)
dmargmodel.ord(y,mu,gam,link)
pmargmodel.ord(y,mu,gam,link)
Arguments
y |
Vector of (non-negative integer) quantiles. |
mu |
The parameter |
gam |
The parameter(s) |
invgam |
The inverse of parameter |
margmodel |
Indicates the marginal model. Choices are “poisson” for Poisson, “bernoulli” for Bernoulli, and “nb1” , “nb2” for the NB1 and NB2 parametrization of negative binomial in Cameron and Trivedi (1998). See details. |
link |
The link function. Choices are “logit” for the logit link function, and “probit” for the probit link function. |
Details
Negative binomial distribution
NB allows for overdispersion
and its probability mass function (pmf) is given by
with mean and variance
.
Cameron and Trivedi (1998) present the NBk parametrization where
and
,
.
In this function we use the NB1 parametrization
, and the NB2 parametrization
; the latter
is the same as in Lawless (1987).
margmodel.ord
is a variant of the code for ordinal (probit and logistic) model. In this case, the response is assumed to have density
where is a function of
and the
-dimensional regression vector
, and
is the $q$-dimensional vector of the univariate cutpoints (
). Note that
normal leads to the probit model and
logistic
leads to the cumulative logit model for ordinal response.
Value
The density and cdf of the univariate distribution.
Author(s)
Aristidis K. Nikoloulopoulos A.Nikoloulopoulos@uea.ac.uk
Harry Joe harry.joe@ubc.ca
References
Cameron, A. C. and Trivedi, P. K. (1998) Regression Analysis of Count Data. Cambridge: Cambridge University Press.
Lawless, J. F. (1987) Negative binomial and mixed Poisson regression. The Canadian Journal of Statistics, 15, 209–225.
Examples
y<-3
gam<-2.5
invgam<-1/2.5
mu<-0.5
margmodel<-"nb2"
dmargmodel(y,mu,gam,invgam,margmodel)
pmargmodel(y,mu,gam,invgam,margmodel)
link="probit"
dmargmodel.ord(y,mu,gam,link)
pmargmodel.ord(y,mu,gam,link)