generateNoise: Function to generate noisy data

View source: R/generateNoise.R

generateNoiseR Documentation

Function to generate noisy data

Description

The function generates a random sample from poisson, overdispersed poisson, binomial and zero inflated binomial samples.

Usage

generateNoise(n, response, family, gamma.variance, ...)

Arguments

n

number of simulations to generate

response

vector of 'true' means to genereate from

family

one of poisson, binomial or zibinomial

gamma.variance

variance parameter for gamma distribution.

...

Other parameters required for the family specified

Details

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.

Author(s)

LAS Scott-Hayward, University of St Andrews

Examples


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


lindesaysh/MRSea documentation built on May 11, 2024, 11:30 p.m.