make.reg.fnc: Make a simulated data set with regression design

Description Usage Arguments Value Author(s) See Also Examples

Description

This convenience function creates a regression data set with subjects, items, and three numerical predictors, and optionally an effect of learning or fatigue. This function is called by simulateRegression.fnc, and is not intended for independent use.

Usage

1
2
3
make.reg.fnc(nsubj = 10, nitem = 20, beta = c(400, 2, 6, 4), 
learn = FALSE, learnRate = 10, stdevItem = 40, stdevSubj = 80, 
  stdevError = 50)

Arguments

nsubj

Number of subjects (random effect) required.

nitem

Number of items (random effect) required.

beta

A numeric vector with four beta weights: one for the intercept and one for each of three predictors.

learn

A logical variable, if TRUE, a learning or fatigue effect will be implemented, as specified by learnRate.

learnRate

A number indicating learning (if negative) or fatigue (if positive).

stdevItem

A number specifying the standard deviation of the Item random effect.

stdevSubj

A number specifying the standard deviation of the Subject random effect.

stdevError

A number specifying the standard deviation of the Residual Error.

Value

A data frame with intercept, predictors labelled X, Y and Z, Item, Subject, the simulated random effects for Item and Subject, the residual errors, and the simulated RTs.

Author(s)

R. H. Baayen

See Also

simulateRegression.fnc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
  simdat = make.reg.fnc()
  require(lme4)
  require(lmerTest)
  require(optimx)
  simdat.lmer = lmer(RT ~ X + Y + Z + (1|Subject) + (1|Item), 
    control=lmerControl(optimizer="optimx",optCtrl=list(method="nlminb")),
    data = simdat)
  summary(simdat.lmer)

  simdat = make.reg.fnc(learn = TRUE)
  simdat.lmer = lmer(RT ~ X + Y + Z + Trial + (1|Subject) + (1|Item), 
    control=lmerControl(optimizer="optimx",optCtrl=list(method="nlminb")),
    data = simdat)
  summary(simdat.lmer)

## End(Not run)

languageR documentation built on May 2, 2019, 10:02 a.m.