ch.moralsFilterDataQ: A function to filter the morals data for analysis using...

ch.moralsFilterDataQR Documentation

A function to filter the morals data for analysis using quantiles rather than fixed values.

Description

This function filters the morals data for analysis by removing RT outliers and bad subjects based on RT and p(hit) using quantiles rather than fixed values. The thresholds for removal are set in the moralsDBfile that is read and stored in a parameter list.

Usage

ch.moralsFilterDataQ(
  data,
  snCol,
  RTcol,
  overlapRoundCol,
  correctCol,
  correctVals = c(TRUE, FALSE),
  statsOutputFile = NULL,
  params
)

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.

RTcol

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

overlapRoundCol

a string that specifies the name of the column in "data" that contains the rounded overlaps for the item in each trial. Column occured in ch.moralsDataPrep().

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

statsOutputFile

the filename that you want the statistics summary output written to. DEFAULT = NULL (construct filename from "params")

params

a list of parameters that are read in using "ch.readMoralsDBfile.r." Use quantiles (e.g., 0.05, rather than fixed values when filling in the lowAveThresholdRT, highAveThresholdRT, lowThresholdRT, and highThresholdRT)

Value

a dataframe of filtered data. It also writes the data to "analysisReadyData.txt," which will be used by other functions.

Examples

ch.moralsFilterData (data=moralsData, "sn", "RT", "overlapRound", "aveRT", "avePred", params=parameters)

ccpluncw/ccpl_R_chMorals documentation built on Feb. 4, 2024, 3:30 p.m.