# calculate.mle: Calculate Parameters Involved in Sampling Procedures In DCluster: Functions for the Detection of Spatial Clusters of Diseases

## Description

When boostrap is used to sample values of the statistic under study, it is possible to use argument mle to pass the values of the parameters involved in the sampling procedure.

## Usage

 `1` ```calculate.mle(d, model="poisson") ```

## Arguments

 `d` A dataframe as described in the DCluster manual page. `model` Model used to sample data. It can be either "multinomial", "poisson" or "negbin".

## Value

A list with the estimates of the parameters involved in the model:

 `Multimonial` Total observed cases (n) and vector of probabilities (p). `Poisson` Total number of regions (n) and vector of means (lambda). `Negative Binomial (Poisson-Gamma)` Total number of regions (n), size and probabilites, calculated after estimating parameters parameters nu and alpha of the Gamma distribution following equations proposed by Clayton and Kaldor (1989).

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```library(spdep) data(nc.sids) sids<-data.frame(Observed=nc.sids\$SID74) sids<-cbind(sids, Expected=nc.sids\$BIR74*sum(nc.sids\$SID74)/sum(nc.sids\$BIR74)) sids<-cbind(sids, x=nc.sids\$x, y=nc.sids\$y) #Carry out simulations datasim<-multinom.sim(sids, mle=calculate.mle(sids, model="multinomal") ) #Estimators for Poisson distribution datasim<-poisson.sim(sids, mle=calculate.mle(sids, model="poisson") ) #Estimators for Negative Binomial distribution datasim<-negbin.sim(sids, mle=calculate.mle(sids, model="negbin") ) ```