ch.plot.pHit: Graph function for Values Experiment

ch.plot.pHitR Documentation

Graph function for Values Experiment

Description

This function creates a graph of p(hit) (0-1 on y-axis) as a function of an x variable (often overlap). It aldo fits a non-linear function to the data whereby the first point is 1 and the last point is .5. It outputs the fit of the function.

Usage

ch.plot.pHit(
  x,
  y,
  useTwoParameterModel = FALSE,
  plotTitle = NA,
  filename = NULL,
  cex1 = 1,
  printR2 = T,
  yLabel = "p(HVO)",
  ...
)

Arguments

x

the x variable for the x-axis (often overlap).

y

the y variable for the y-axis (often p(hit)).

useTwoParameterModel

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

plotTitle

a string with the title of the plot.

filename

a string with the filename of the pdf of the file to be saved. DEFAULT = NULL; no file saved.

cex1

a numeric value for cex: the relative size of the text in the graph. cex1 > 1 is bigger; cex1 < 1 is smaller. DEFAULT=1.

printR2

do you want the r square printed on the graph: TRUE/FALSE. DEFAULT=TRUE.

yLabel

a string with the title of y-axis. DEFAULT='p(hit)'

Value

a list of the fit, r2, and beta, from the nls .

Examples

ch.plot.pHit (x,y)

ccpluncw/ccpl_R_chutils documentation built on Feb. 28, 2024, 1:17 a.m.