betabinomial: Beta-Binomial probabilities of ordinal responses, with...

Description Usage Arguments Details Value References See Also Examples

Description

Compute the Beta-Binomial probabilities of ordinal responses, given feeling and overdispersion parameters for each observation.

Usage

1
betabinomial(m,ordinal,csivett,phivett)

Arguments

m

Number of ordinal categories

ordinal

Vector of ordinal responses (factor type)

csivett

Vector of feeling parameters of the Beta-Binomial distribution for the given ordinal responses

phivett

Vector of overdispersion parameters of the Beta-Binomial distribution for the given ordinal responses

Details

The Beta-Binomial distribution is the Binomial distribution in which the probability of success at each trial is not fixed but random and follows the Beta distribution. It is frequently used in Bayesian statistics, empirical Bayes methods and classical statistics as an overdispersed binomial distribution.

Value

A vector of the same length as ordinal, containing the Beta-Binomial probability of each observation, for the corresponding feeling and overdispersion parameters.

References

Iannario, M. (2014). Modelling Uncertainty and Overdispersion in Ordinal Data, Communications in Statistics - Theory and Methods, 43, 771–786
Piccolo D. (2015). Inferential issues for CUBE models with covariates. Communications in Statistics - Theory and Methods, 44(23), 771–786.

See Also

betar, betabinomialcsi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(relgoods)
attach(relgoods)
m<-10
ordinal<-na.omit(Tv)
naTv<-which(is.na(Tv))
age<-2014-BirthYear[-naTv]
lage<-log(age)-mean(log(age))
gama<-c(-0.6, -0.3)
csivett<-logis(lage,gama)
alpha<-c(-2.3,0.92)
phivett<-1/(-1+1/(logis(lage,alpha)))
pr<-betabinomial(m,ordinal,csivett,phivett)
plot(density(pr))


Search within the CUB package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.