makeBbdpars {dbd} | R Documentation |
Create an object of class "Bbdpars"
.
Description
Create an object of class "Bbdpars"
which may be used
as an argument of the simulate()
function.
Usage
makeBbdpars(m, s, size, ndata)
Arguments
m |
Numeric scalar between 0 and 1. May be interpreted as a “success probability”. |
s |
Numeric scalar, greater than 0. The overdispersion parameter
of the beta binomial distribution. Note that if overdispersion
is defined to equal the ratio of the variance of the data to
the corresponding “binomial variance” (i.e.
the actual variance over |
size |
Integer scalar specifying the upper limit of the “support”
of the beta binomial distribution under consideration. The support
is the set of integers |
ndata |
Integer vector specifying the lengths of the data sets to
be simulated. If it is of length less than the |
Value
An object of class "Bbdpars"
which is a list with components
m
, s
, size
and ndata
. The entries
of this list are simply the corresponding function arguments.
Author(s)
Rolf Turner r.turner@auckland.ac.nz
See Also
Examples
obj1 <- makeBbdpars(m=0.35,s=0.3,size=20,ndata=500)
obj2 <- makeBbdpars(m=0.85,s=1.7,size=20,ndata=30*(1:10))
## Not run:
sdat1 <- simulate(obj1,nsim=100)
sdat2 <- simulate(obj2,nsim=100)
## End(Not run)
sdat3 <- simulate(obj2,nsim=10)
## Not run:
sdat4 <- simulate(obj2,nsim=100,ndata=100*(2:6)) # The ndata component of
# obj2 is ignored.
## End(Not run)