ch.moralsGrpRTpHit: A function to analyze the group Morals data

ch.moralsGrpRTpHitR Documentation

A function to analyze the group Morals data

Description

This function analyzes the group morals data.

Usage

ch.moralsGrpRTpHit(
  data,
  trialCol,
  RTCol,
  fitCol,
  resCol,
  overlapRoundCol,
  yesNoCol,
  yesNoVal = c("Yes", "No"),
  correctCol,
  correctVals = c(TRUE, FALSE),
  useTwoParameterModel = FALSE,
  params
)

Arguments

data

the morals dataframe after running through ch.moralsDataPrep().

trialCol

a string that specifies the name of the column in "data" that contains the trial number.

fitCol

a string that specifies the name of the new column that will contain the predicted datapoints.

resCol

a string that specifies the name of the new column that will contain the residual datapoints.

overlapRoundCol

a string that specifies the name of the column in "data" that contains the overlap column.

yesNoCol

a string the specifies the column name in "data" that contains the variable with the participant's yes/no response.

yesNoVal

a vector of two values that specifies the yes "take action" value (index 1) and the no "take no action" value (index 2). e.g, c("yes", "no")

correctCol

a string that specifies the name of the new column that will contains a "1" if the participant chose the item with the greatest value distribution and a "0" if they did not.

correctVals

a vector of two values that specifies the "correct" value (index 1) and the "incorrect" value (index 2). e.g, c("yes", "no")

useTwoParameterModel

A boolean that specifies whether to use a two parameter p(HOV) model. If this is set to TRUE, then this function will fit a p(HVO) model whereby the rightmost point (overlap = 1.0) is not fixed at p(HVO) = 0.5. DEFAULT = FALSE.

params

a list of parameters that are read in using "ch.readMoralsDBfile.r."

RTcol

a string that specifies the name of the column in "data" that contains the RT for each trial.

Value

dataframe with the learning function fit and residuals

Examples

ch.moralsGrpRTpHit (data=moralsData,"trial", "RT", "res.RT", "fit.RT", "overlap", "keyDef", c("Yes", "No"), "correct", c("yes", "no"), params=parameters)

ccpluncw/ccpl_R_chMorals documentation built on June 15, 2025, 3:02 a.m.