Description Usage Arguments Details Value Author(s) References Examples

This function calculates the maximum likelihood estimation of the probability parameter in a binomial distribution. It also returns the standard errors of the estimator, and the upper and lower bounds of the interval of confidence. There is the option to include a dispersion parameter in the model, which is estimated by the method of moments.

1 |

`y` |
the variable under the binomial distribution assumption we want to model. |

`n` |
the maximum score of the binomial trials. |

`disp` |
if |

The estimation of the probability parameter is calculated by maximum likelihood considering the binomial distribution as a general exponential family distribution. The log-likelihood is derived and equated to zero, the solution maximizes the log-likelihood. It also returns the standard error of the estimator, which is obtained by the Fisher information formula, i.e., the second derivate of the log-likelihood inserting the mle.

On the other hand, once the mle of the probability parameter has been found out, the dispersion parameter is estimated by the method of moments by the following formula,

*Var[Y]=φ np(1-p)*

We replace the estimated value of the probability parameter and the calculated variance of the variable in the formula giving the estimated value of the dispersion parameter.

`p` |
the maximum likelihood estimation of the probability parameter. |

`se` |
the standard errors of the mle. |

`low.ic` |
the lower bound of the confidence interval of the mle. |

`up.ic` |
the upper bound of the confidence interval of the mle. |

`phi` |
if the |

Josu Najera Zuloaga

Dae-Jin Lee

Pawitan Y. (2001): In All Likelihood: Statistical Modelling and Inference Using Likelihood, *Oxford University Press*

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
set.seed(9)
# We simulated the binomial data with some parameters and then
# we are going to try to reach the same estimations.
n <- 10 # the maximum score of the Binomial trials
k <- 100 # number of simulations
p <- 0.654 # probability parameter
y <- rbinom(k,n,p) # simulations
# without overdispersion
BIest(y,n) #no overdispersion by default
# with overdispersion
BIest(y,n,TRUE)
``` |

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.