Learn R Programming

EMC2 (version 3.1.0)

mapped_pars: Parameter Mapping Back to the Design Factors

Description

Maps parameters of the cognitive model back to the experimental design. If p_vector is left unspecified will print a textual description of the mapping. Otherwise the p_vector can be created using sampled_pars(). The returned matrix shows whether/how parameters differ across the experimental factors.

Usage

mapped_pars(
  x,
  p_vector = NULL,
  model = NULL,
  digits = 3,
  remove_subjects = TRUE,
  covariates = NULL,
  ...
)

# S3 method for emc.design mapped_pars( x, p_vector = NULL, model = NULL, digits = 3, remove_subjects = TRUE, covariates = NULL, ... )

# S3 method for emc.prior mapped_pars( x, p_vector = NULL, model = NULL, digits = 3, remove_subjects = TRUE, covariates = NULL, ... )

# S3 method for emc mapped_pars( x, p_vector = NULL, model = NULL, digits = 3, remove_subjects = TRUE, covariates = NULL, ... )

Value

Matrix with a column for each factor in the design and for each model parameter type (p_type).

Arguments

x

an emc, emc.prior or emc.design object

p_vector

Optional. Specify parameter vector to get numeric mappings. Must be in the form of sampled_pars(design)

model

Optional model type (if not already specified in design)

digits

Integer. Will round the output parameter values to this many decimals

remove_subjects

Boolean. Whether to include subjects as a factor in the design

covariates

Covariates specified in the design can be included here.

...

optional arguments

Examples

Run this code
# First define a design:
design_DDMaE <- design(data = forstmann,model=DDM,
                           formula =list(v~0+S,a~E, t0~1, s~1, Z~1, sv~1, SZ~1),
                           constants=c(s=log(1)))
mapped_pars(design_DDMaE)
# Then create a p_vector:
p_vector=c(v_Sleft=-2,v_Sright=2,a=log(1),a_Eneutral=log(1.5),a_Eaccuracy=log(2),
          t0=log(.2),Z=qnorm(.5),sv=log(.5),SZ=qnorm(.5))
# This will map the parameters of the p_vector back to the design
mapped_pars(design_DDMaE, p_vector)

Run the code above in your browser using DataLab