MIA: Marginal Increment Analysis Plot

View source: R/MI_functions.R

MIAR Documentation

Marginal Increment Analysis Plot

Description

MIA creates a marginal increment analysis plot.

Usage

MIA(
  Data,
  Statistics,
  x.label = "Month",
  pch.raw = 20,
  col.raw = "#0080ff",
  alpha.raw = 0.5,
  cex.raw = 0.8,
  pch.fit = 16,
  col.fit = "black",
  cex.fit = 1,
  col.text = "Black",
  cex.text = 1
)

Arguments

Data

Data frame containing, at a minimum, two columns. The first column should represnt the x-variable. The 2nd column should represent the y-variable. Other columns may be present.

Statistics

Data frame containing, at a minimum, four colummns. The first column should represent the x-variable. The 2nd column should represent the y-variable, typically the mean of y at a given x. The 3rd column should represent a measure of variability, typically the confidence interval of y given x. The 4th column should represent the number of samples of y at a given level of x. Other columns may be present in the data frame.

x.label

Text label for the x-axis of the plot

pch.raw

symbol to use for the raw x and y data found in Data

col.raw

color to use for the raw x and y data found in Data

alpha.raw

amount of transparency of the raw x and y data found in Data

cex.raw

symbol size to use for the raw x and y data found in Data

pch.fit

symbol to use for the summarized marginal increment data found in Statistics

col.fit

color to use for the summarized marginal increment data found in Statistics

cex.fit

symbol size to use for the summarized marginal increment data found in Statistics

col.text

color of text to use for depiciting the sample size at each x variable level

cex.text

text size to use for depiciting the sample size at each x variable level bias plot between Reader 2 and Reader 1 ages.

Value

A xyplot using the package lattice depicting the results of a marginal increment analysis.

See Also

MIA.Edge

Examples

# Example with Sheepshead Data
data(Sheepshead)
Data <- data.frame(Month = Sheepshead$Month,
                   Perc.Comp = Sheepshead$MI/Sheepshead$Prev.Inc)
Data$Perc.Comp <- with(Data, ifelse(Perc.Comp >1, 1, Perc.Comp))
Statistics <- with(Data, aggregate(Perc.Comp ~ Month, FUN = describe,
   digits = 4 ))
Statistics <- cbind(Statistics[-ncol(Statistics)],
   Statistics[[ncol(Statistics)]])
MIA(Data = Data, Statistics = Statistics[, c(1, 3, 6, 2)])

ballengerj/FishyR documentation built on June 17, 2022, 10:33 p.m.