View source: R/generateNoise.R
generateNoise | R Documentation |
The function generates a random sample from poisson, overdispersed poisson, binomial and zero inflated binomial samples.
generateNoise(n, response, family, gamma.variance, ...)
n |
number of simulations to generate |
response |
vector of 'true' means to genereate from |
family |
one of |
gamma.variance |
variance parameter for |
... |
Other parameters required for the family specified |
An additional parameter for the Poisson distribution is the dispersion parameter, specified by d=
The additional parameters for the Binomial distribution can be found in ?VGAM::rbinom
The zibinomial family requires the VGAM
library to generate zero inflated binomial data. Additional parameters can be found in the help for rzibinom
.
LAS Scott-Hayward, University of St Andrews
data(ns.data.re)
model<-gamMRSea(birds ~ observationhour + as.factor(floodebb) + as.factor(impact),
family='poisson', data=ns.data.re)
simData<-generateNoise(n=500, response=fitted(model), family='poisson')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.