View source: R/dataSimulation.R
simDat123 | R Documentation |
Generate counts of hares in two landuse types when there may be zero-inflation (this is a simple general hierarchical model, see Chapters 19 and 19B in the book)
simDat123(nSites = 50, alpha = log(2), beta = log(5) - log(2), psi = 0.2)
nSites |
Number of sites |
alpha |
Intercept |
beta |
Slope for land use |
psi |
Zero inflation parameter (probability of structural 0) |
A list of simulated data and parameters.
nSites |
Number of sites |
alpha |
Intercept |
beta |
Slope for land use |
psi |
Zero inflation parameter |
w |
Indicator that count is not a structural 0 |
C |
Simulated hare counts with zero inflation |
Marc Kéry
str(dat <- simDat123()) # Implicit default arguments
# Drop zero inflation (and make sample sizes bigger)
str(dat <- simDat123(nSites = 1000, psi = 0)) # Note 0 % of the sites have structural zeroes now
# Half of all sites have structural zeroes
str(dat <- simDat123(nSites = 1000, psi = 0.5))
# Revert to "model-of-the-mean" without zero inflation
# 0 % of the sites have structural zeroes
str(dat <- simDat123(nSites = 1000, beta = 0, psi = 0))
# Revert to "model-of-the-mean" with zero inflation
# 50 % of the sites have structural zeroes
str(dat <- simDat123(nSites = 1000, beta = 0, psi = 0.5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.