Learn R Programming

ASMbook (version 1.0.2)

simDat122: Simulate data for Chapter 12.2: Overdispersed counts

Description

Generate counts of hares in two landuse types when there may be overdispersion relative to a Poisson

Usage

simDat122(nSites = 50, alpha = log(2), beta = log(5) - log(2), sd = 0.5)

Value

A list of simulated data and parameters.

nSites

Number of sites

alpha

Intercept

beta

Slope for land use

sd

Standard deviation for overdispersion

C_OD

Simulated hare counts with overdispersion

C_Poisson

Simulated hare counts without overdispersion

Arguments

nSites

Number of sites

alpha

Intercept

beta

Slope for land use

sd

Standard deviation for overdispersion

Author

Marc Kéry

Examples

Run this code
str(dat <- simDat122())      # Implicit default arguments

# Much greater OD to emphasize patterns (also larger sample size)
str(dat <- simDat122(nSites = 100, sd = 1))

# Revert to "Poisson model-of-the-mean" (i.e., without an effect of landuse type)
str(dat <- simDat122(nSites = 100, beta = 0, sd = 1))

Run the code above in your browser using DataLab