generateData: Generate simulated data

Description Usage Arguments Value

View source: R/generateData.R

Description

Generate data for a regural monitoring design. The counts follow a negative binomial distribution with given size paramters and the true mean mu depending on a year, period and site effect. All effects are independent fro each other and have, on the log-scale, a normal distribution with zero mean and given standard deviation.

Usage

1
2
3
4
5
6
generateData(intercept = 2, n.year = 24, n.period = 6, n.site = 20,
  year.factor = FALSE, period.factor = FALSE, site.factor = FALSE,
  trend = 0.01, sd.rw.year = 0.1, amplitude.period = 1,
  mean.phase.period = 0, sd.phase.period = 0.2, sd.site = 1,
  sd.rw.site = 0.02, sd.noise = 0.01, size = 2, n.run = 10,
  as.list = FALSE, details = FALSE)

Arguments

intercept

the global mean on the log-scale

n.year

the number of years

n.period

the number of periods

n.site

the number of sites

year.factor

convert year to a factor. Defaults to FALSE

period.factor

convert period to a factor. Defaults to FALSE

site.factor

convert site to a factor. Defaults to FALSE

trend

the longterm linear trend on the log-scale

sd.rw.year

the standard deviation of the year effects on the log-scale

amplitude.period

the amplitude of the periodic effect on the log-scale

mean.phase.period

the mean of the phase of the periodic effect among years. Defaults to 0.

sd.phase.period

the standard deviation of the phase of the periodic effect among years

sd.site

the standard deviation of the site effects on the log-scale

sd.rw.site

the standard deviation of the random walk along year per site on the log-scale

sd.noise

the standard deviation of the noise effects on the log-scale

size

the size parameter of the negative binomial distribution

n.run

the number of runs with the same mu

as.list

return the dataset as a list rather than a data.frame. Defaults to FALSE

details

add variables containing the year, period and site effects. Defaults tot FALSE

Value

A data.frame with five variables. Year, Month and Site are factors identifying the location and time of monitoring. Mu is the true mean of the negative binomial distribution in the original scale. Count are the simulated counts.


inbo/multimput documentation built on Dec. 16, 2019, 6:04 p.m.