ch.moralsSnRTpHit: A function to analyze the Morals data by subject

ch.moralsSnRTpHitR Documentation

A function to analyze the Morals data by subject

Description

This function analyzes the group morals data.

Usage

ch.moralsSnRTpHit(
  data,
  snCol,
  trialCol,
  RTCol,
  fitCol,
  resCol,
  overlapCol,
  correctCol,
  correctVals = c(TRUE, FALSE),
  useTwoParameterModel = FALSE,
  params,
  minUniqueOverlaps = 3
)

Arguments

data

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

snCol

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

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.

overlapCol

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

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."

minUniqueOverlaps

An integer specifying the minimum number of unique overlap bins necessary for the program to calculate the pHVO and RT function. DEFAULT = 3.

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.moralsSnRTpHit (data=moralsData,"sn", "trial", "RT", "res.RT", "fit.RT", "overlap", "keyDef", c("Yes", "No"), "correct", params=parameters)

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