observed.sim: Randomly Generate Observed Cases from Different Statistical...

observed.simR Documentation

Randomly Generate Observed Cases from Different Statistical Distributions


Simulate Observed number of cases according to a Multinomial, Poisson or Negative Binomial distribution.

These functions are used when performing a parametric bootstrap and they must be passed as argument ran.gen when calling function boot.

multinom.sim generates observations from a Multinomial distribution.

poisson.sim generates observations from a Poisson distribution.

negbin.sim generates observations from a Negative Binomial distribution.


multinom.sim(data, mle=NULL)

poisson.sim(data, mle=NULL)

negbin.sim(data, mle=NULL)



A dataframe as described in the DCluster manual page.


List containing the parameters of the distributions to be used. If they are not provided, then they are calculated from the data. Its value argument mle in function boot.

The elements in the list depend on the distribution to be used:

  • Multimonial

    Total observed cases (n) and vector of probabilities (p).

  • Poisson

    Total number of regions (n) and vector of means (lambda).

  • Negative Binomial

    Total number of regions (n) and parameters nu and alpha of the Gamma distribution.


A dataframe equal to the argument data, but in which the Observed column has been substituted by sampled observations. See DCluster manual page for more details.

See Also





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") )

DCluster documentation built on Sept. 3, 2023, 5:07 p.m.