ch.moralsModelOvrlpPredPhitQ: A function to fit and plot a model whereby p(hit)quantity...

ch.moralsModelOvrlpPredPhitQR Documentation

A function to fit and plot a model whereby p(hit)quantity (that is, where the correct answer is the Item with the greatest quantity) is predicted by the overlap of value.

Description

This function fits and plots a model whereby p(hit)quantity (that is, where the correct answer is the Item with the greatest quantity) is predicted by the overlap of value. This model is used to show that values values can predict p(Hit)quantity when values overlap is considered. The model is as follows: p(Hit)quantity = a + b1*(-1*sType) + b2*(sType*OverlapRound), where sType ==1 if targetPresent(quantity) is inconsistent with targetPresent(value), and -1 if it is consistent. OverlapRound is the overlap of the values distributions.

Usage

ch.moralsModelOvrlpPredPhitQ(
  data,
  OvrlpQuantConsistentCol,
  itemQuantDiffCol,
  overlapRoundCol,
  pHitQCol,
  minN = NULL,
  filename = NULL,
  grpLgndNames = NULL,
  lgndPlacement = "topright",
  cex1 = 1.5,
  cexLegend = 0.75,
  ylim = c(0, 1),
  yLab = "p(HitQuant)",
  xlab = "Overlap",
  parOp = NULL,
  showLegend = TRUE,
  ...
)

Arguments

data

a morals dataframe.

OvrlpQuantConsistentCol

a string the specifies the column name in "data" that contains the a boolean that specifies whether targetPresent(quantity) is consistent with targetPresent(value) (TRUE) or not (FALSE).

itemQuantDiffCol

a string the specifies the column name in "data" that contains the absolute value of the quantity difference between Item1 and Item2.

overlapRoundCol

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

pHitQCol

a string that specifies the name of the column in "data" that contains a "1" if the participant chose the item with the greatest quantity and a "0" if they did not.

minN

an integer indicating the minimum number of trials in each condition that is valid for analysis. Below that number, the condition will be removed. DEFAULT = NULL.

filename

the filename (pdf) to save the output of the graph. DEFAULT = NULL (no graph saved)

lgndPlacement

a string that specified the placement of the legend: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". DEFAULT = "topright"

cex1

the relative font size for the y-axis label. DEFAULT = 1.

cexLegend

the relative font size for the legend. DEFAULT = .75.

ylim

the limits of the y axis. DEFAULT = c(0,1).

yLab

y axis label. DEFAULT = "p(HitQuant)".

parOp

the parameter list to enter into par. DEFAULT = NULL

showLegend

A boolean to print the legend on the graph. DEFAULT = TRUE

xLab

x axis label. DEFAULT = "Overlap".

Value

the lm model fit.

Examples

ch.moralsQuantAnalyis (analysisReadyData.gp, "probe1", "probe2")

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