datgen {rAverage}R Documentation

Generating Noisy Responses for an Averaging Model

Description

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

Usage

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.

Value

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)

[Package rAverage version 0.5-8 Index]