Description Usage Arguments Details Value References See Also Examples

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

1 | ```
betabinomial(m,ordinal,csivett,phivett)
``` |

`m` |
Number of ordinal categories |

`ordinal` |
Vector of ordinal responses. Missing values are not allowed: they should be preliminarily deleted or imputed |

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

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

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

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

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
data(relgoods)
m<-10
ordinal<-relgoods$Tv
age<-2014-relgoods$BirthYear
no_na<-na.omit(cbind(ordinal,age))
ordinal<-no_na[,1]; age<-no_na[,2]
lage<-log(age)-mean(log(age))
gama<-c(-0.6, -0.3)
csivett<-logis(lage,gama)
alpha<-c(-2.3,0.92);
ZZ<-cbind(1,lage)
phivett<-exp(ZZ%*%alpha)
pr<-betabinomial(m,ordinal,csivett,phivett)
plot(density(pr))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.