Learn R Programming

rAverage (version 0.3-2)

averaging: Generating Responses for an Averaging Model

Description

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

Usage

averaging(param, lev, trials = 1, sd = 0, range = NULL)

Arguments

param
Numerical vector containing the 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).
trials
Number of rows of the output matrix.
sd
Variability of the responses R whithin each column of the output matrix.
range
Numeric vector. Range of the responses.

Value

  • A matrix object containing the 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.indexes, rAverage-package, rav.cmd

Examples

Run this code
# Generating random parameters for a 3x4 design:
# par <- pargen(lev = c(3,4), s.range = c(0,20))
# Computing the responses:
# R <- averaging(param=par, lev=c(3,4), sd=0) ; R
# R <- averaging(param=par, lev=c(3,4), sd=1, trials=10, range=c(0,20)) ; R

Run the code above in your browser using DataLab