Learn R Programming

languageR (version 1.5.0)

simulateLatinsquare.fnc: Simulate simple Latin Square data and compare models

Description

This function creates a user-specified number of simulated datasets with a Latin Square design, and compares mixed-effects models with the by-subject anova.

Usage

simulateLatinsquare.fnc(dat, with = TRUE, trial = 0, nruns = 100, 
   nsub = NA, nitem = NA, ...)

Arguments

dat

A data frame with the structure of the data set latinsquare.

with

Logical, if TRUE, effect of SOA built into the data.

trial

A number which, if nonzero, gives the magnitude of a learning or a fatigue effect.

nruns

A number indicating the required number of simulation runs.

nsub

A number for the number of subjects.

nitem

A number for the number of items.

...

other parameters to be passed through to plotting functions.

Value

A list with components

alpha05

Description of 'comp1'

alpha01

proportion of runs in which predictors are significant at the 05 significance level.

res

Data frame with simulation results.

with

Logical, TRUE if SOA effect is built into the simulations.

Examples

Run this code
# NOT RUN {
  data(latinsquare)
	\dontrun{
	library(lme4)
  simulateLatinsquare.fnc(latinsquare, nruns=100)
	}
# }

Run the code above in your browser using DataLab