plot.StratSel function

Plots a StratSel Object

Plots a StratSel Object

Plots predicted probabilities for all three possible outcomes based on an object of class StratSel.

## S3 method for class 'StratSel' plot(x, profile, x.move, x.range, uncertainty = FALSE, n.sim = 100, ci = 0.95, ylim, xlab, ylab1, ylab2, ylab3, plot.nr, ...)

Arguments

  • x: An object of class StratSel
  • profile: Vector. The values of all independent variables including the three constants.
  • x.move: Scalar. Indicates which variable is changing (and displayed on the x-axis).
  • x.range: Vector. A vector with two elements. The x which is moving will start at x.range[1] and end at x.range[2].
  • uncertainty: Logical. Indicates whether confidence bands should be displayed or not.
  • n.sim: Scalar. If uncertainty=TRUE the prediction uncertainty is generated with a simulation based on n.sim simulations. Default is 100. It is recommended to use 1000 simulations.
  • ci: Scalar. Indicates which confidence interval should be plotted, the default is 0.95.
  • ylim: Vector. A vector with two elements defining the range of the plotted y (predicted probability).
  • xlab: String. A label to be used for the x-axis. Will be recycled in all three plots.
  • ylab1: String. Label for the y-axis of the first plot (predicted probability of outcome 1).
  • ylab2: String. Label for the y-axis of the second plot (predicted probability of not outcome 1).
  • ylab3: String. Label for the y-axis of the third plot (predicted probability of outcome 4).
  • plot.nr: Vector. If one does not want to plot all three outcomes, one can use this vector to indicate which plot(s) should be shown.
  • ...: Further arguments to be supplied to plot.

Author(s)

Lucas Leemann lleemann@gmail.com

Examples

data(data.fake) # Running just an agent error model (note: corr=FALSE) with \code{var.C} being #part of both actors' utilities out1 <- StratSel(Y ~ var.A + var.B | var.C + var.D | var.E + var.C, data=data.fake, corr=FALSE) par(mfrow=c(3,1)) plot(out1, profile=c(1,0.2,-0.2,1,0.2,-0.2,1,0.1,-0.3), x.move=c(5,9),x.range=c(-15,15), ci=0.7, uncertainty=TRUE)
  • Maintainer: Lucas Leemann
  • License: GPL (>= 2)
  • Last published: 2025-03-24

Useful links