sepplot: Generate a Separation Plot

View source: R/plot.spdur.R

sepplotR Documentation

Generate a Separation Plot

Description

A separationplot wrapper for class “spdur”.

Usage

sepplot(
  x,
  pred_type = "conditional hazard",
  obs = NULL,
  endSpellOnly = FALSE,
  lwd1 = 5,
  lwd2 = 2,
  shuffle = TRUE,
  heading = "",
  show.expected = TRUE,
  newplot = FALSE,
  type = "line",
  ...
)

Arguments

x

An object of class "spdur".

pred_type

Which statistic to plot, i.e. "conditional hazard" or "conditional risk".

obs

Variable that captures observed outcomes. If NULL (default), it is chosen based on pred_type: "fail" for (conditional) hazard, and "atrisk" for (conditional) risk.

endSpellOnly

Should only the last observation in each spell be kept? FALSE by default.

lwd1

See separationplot.

lwd2

See separationplot.

shuffle

See separationplot.

heading

See separationplot.

show.expected

See separationplot.

newplot

See separationplot

type

See separationplot.

...

Optional parameters passed to separationplot, e.g. type of statistic to calculate.

Details

Creates a separation plot of fitted values from split-duration model results using predict.spdur.

See Also

separationplot, predict.spdur

Examples

# get model estimates
library(separationplot)
data(model.coups)

# plot
p <- plot(model.coups)
p


spduration documentation built on May 29, 2024, 1:30 a.m.