datgen function

Generating Noisy Responses for an Averaging Model

Generating Noisy Responses for an Averaging Model

This function generates noisy synthetic responses R for an averaging model given the true parameters s0, w0, s(k,j), and w(k,j).

datgen(param, lev, t.par = FALSE, trials = 1, sd = 0, range = NULL)

Arguments

  • param: Numerical vector containing the true parameters for the function, with the order s0, w0, s(k,j), and w(k,j).
  • lev: Vector containing the number of levels of each factor. For instance, two factors with respectively 3 and 4 levels require lev = c(3,4).
  • t.par: Attribute that specifies whether the weight parameters should be written in the 't' form or in the 'w' form.
  • trials: Number of rows of the output matrix.
  • sd: Standard deviation of the noise addded to the responses R whithin each column of the output matrix.
  • range: Numeric vector. Range of the responses.

Returns

A matrix object containing the generated responses of the averaging model, in the order: one-way design, two-way design, three way design, etc. See rav function.

See Also

rav, pargen, rav.indices, rAverage-package

Examples

## Not run: # Generating random parameters for a 3x4 design: par <- pargen(lev = c(3,4), s.range = c(0,20)) # Computing the responses: R <- datgen(param=par, lev=c(3,4), sd=0) ; R R <- datgen(param=par, lev=c(3,4), sd=1, trials=10, range=c(0,20)) ; R ## End(Not run)
  • Maintainer: Davide Massidda
  • License: GPL (>= 2)
  • Last published: 2017-07-29

Useful links