Learn R Programming

rtmpt (version 2.0-3)

set_resps: Set responses in an ertmpt_model or a drtmpt_model

Description

Change the responses for a tree and the categories within that tree.

Usage

set_resps(model, tree, categories, values = 0)

Value

A list of the class ertmpt_model or drtmpt_model.

Arguments

model

A list of the class ertmpt_model or drtmpt_model.

tree

Character or numerical value of the tree for which the responses should be changed.

categories

Character or numerical vector identifying category/ies within the specified tree for which the responses should be changed.

values

Numerical vector of length length(categories) providing the responses. Default is 0.

Author

Raphael Hartmann

Examples

Run this code
#########################################################################
# Detect-Guess variant of the Two-High Threshold model.
# The encoding and motor execution times will be set to different values 
#   for each response.
#########################################################################

mdl_2HTM <- "
# targets
do+(1-do)*g
(1-do)*(1-g)

# lures
(1-dn)*g
dn+(1-dn)*(1-g)

# do: detect old; dn: detect new; g: guess
"

model <- to_ertmpt_model(mdl_file = mdl_2HTM)

## changing the model to have two different encoding and response execution 
## times for "old" and "new" responses.
for(i in c(0,1)) model <- set_resps(model = model, tree = i, 
                                    categories = i*2+1, values = 1)


#' model <- to_drtmpt_model(mdl_file = mdl_2HTM)

## changing the model to have two different encoding and response execution 
## times for "old" and "new" responses.
for(i in c(0,1)) model <- set_resps(model = model, tree = i, 
                                    categories = i*2+1, values = 1)
                                 

Run the code above in your browser using DataLab