addnoise {emon} | R Documentation |
Creates random errors for use in power.trend.
Description
This function is used within power.trend
.
Distribution of noise can be either Normal, Poisson or Negative Binomial. The mean values are entered
as a parameter (possibly generated by function generate.trend
). Other parameters (sd
for Normal,
nbsize
for Negative Binomial) need to be given. Values in meanvalues
are used as the mean values for one of the three
specified distributions and then a random allocation is made for each of the nobs
values, where nobs
is the
length of meanvalues
.
Usage
addnoise(meanvalues, reps, distribution, sd, nbsize, randeffect, randeffect.sd)
Arguments
meanvalues |
Vector of mean values |
reps |
Number of replicates per time point |
distribution |
Character string which must be one of |
sd |
Standard Deviation for Normal distribution |
nbsize |
Size parameter for Negative Binomial distribution |
randeffect |
Not working yet |
randeffect.sd |
Not working yet |
Value
Output is a vector of the same length as meanvalues
.
Author(s)
David Maxwell: David.Maxwell@cefas.co.uk