View source: R/get_transformed_data.R
to_ertmpt_data | R Documentation |
Transform data, such that it can be used in fit_ertmpt
. This implies changing each value/label in
"subj", "group", "tree", and "cat" to numbers such that it starts from zero (e.g. data$tree = c(1,1,3,3,2,2,...)
will be changed to data$tree = c(0,0,2,2,1,1,...)) and the columns will be ordered in the right way.
"rt" must be provided in milliseconds. If it has decimal places it will be rounded to a whole number.
fit_ertmpt
will automatically call this function if its input is not already an ertmpt_data
list,
but it is advised to use it anyway because it provides information about the transformations of the data.
to_ertmpt_data(raw_data, model)
to_rtmpt_data(raw_data, model)
raw_data |
|
model |
A list of the class |
A list of the class ertmpt_data
containing transformed data and information about
the transformation that has been done.
Raphael Hartmann
####################################################################################
# Detect-Guess variant of the Two-High Threshold model.
# The encoding and motor execution times are assumed to be equal for each response.
####################################################################################
eqn_2HTM <- "
# CORE MPT EQN
# tree ; cat ; mpt
target ; hit ; do
target ; hit ; (1-do)*g
target ; miss ; (1-do)*(1-g)
lure ; f_a ; (1-dn)*g
lure ; c_r ; dn
lure ; c_r ; (1-dn)*(1-g)
"
model <- to_ertmpt_model(eqn_file = eqn_2HTM)
data_file <- system.file("extdata/labeled_data.txt", package="rtmpt")
data <- read.table(file = data_file, header = TRUE)
data_list <- to_ertmpt_data(raw_data = data, model = model)
data_list
eqn_2HTM <- "
# CORE MPT EQN
# tree ; cat ; mpt
target ; hit ; do
target ; hit ; (1-do)*g
target ; miss ; (1-do)*(1-g)
lure ; f_a ; (1-dn)*g
lure ; c_r ; dn
lure ; c_r ; (1-dn)*(1-g)
"
model <- to_rtmpt_model(eqn_file = eqn_2HTM)
data_file <- system.file("extdata/labeled_data.txt", package="rtmpt")
data <- read.table(file = data_file, header = TRUE)
data_list <- to_rtmpt_data(raw_data = data, model = model)
data_list
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.