cplot_extract: Generic extracts model information for use by 'cplot'

Description Usage Arguments

View source: R/cplot_extract.R

Description

Generic extracts model information for use by 'cplot'

Internal function to extract data for 'cplot'

Usage

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
## S3 method for class 'clm'
cplot_extract(
  object,
  data,
  dx,
  level,
  xvar,
  at,
  n,
  type,
  xvals,
  vcov,
  what,
  zvar,
  zvals,
  ...
)

cplot_extract(object, ...)

## Default S3 method:
cplot_extract(
  object,
  data,
  dx,
  level,
  xvar,
  zvar,
  xvals,
  zvals,
  at,
  n,
  type,
  vcov,
  what,
  ...
)

## S3 method for class 'glm'
cplot_extract(
  object,
  data,
  dx,
  level,
  xvar,
  zvar,
  xvals,
  zvals,
  at,
  n,
  type,
  vcov,
  what,
  ...
)

## S3 method for class 'lm'
cplot_extract(
  object,
  data,
  dx,
  level,
  xvar,
  zvar,
  xvals,
  zvals,
  at,
  n,
  type,
  vcov,
  what,
  ...
)

## S3 method for class 'loess'
cplot_extract(
  object,
  data,
  dx,
  level,
  xvar,
  zvar,
  xvals,
  zvals,
  at,
  n,
  type,
  vcov,
  what,
  ...
)

## S3 method for class 'polr'
cplot_extract(
  object,
  data,
  dx,
  level,
  xvar,
  at,
  n,
  type,
  xvals,
  vcov,
  what = c("prediction", "classprediction", "stackedprediction", "effect"),
  zvar,
  zvals,
  ...
)

## S3 method for class 'multinom'
cplot_extract(
  object,
  data,
  dx,
  level,
  xvar,
  at,
  n,
  type,
  xvals,
  vcov,
  what = c("prediction", "classprediction", "stackedprediction", "effect"),
  zvar,
  zvals,
  ...
)

Arguments

object

A statistical model object

data

data.frame over which to calculate individual marginal effects or predictions

dx

The name of the variable whose effect should be plotted

level

The confidence level required (used to draw uncertainty bounds).

xvar

The name of the variable to show on the x-axis

at

Currently ignored.

n

An integer specifying the number of points across x at which to calculate the predicted value or marginal effect, when x is numeric. Ignored otherwise.

type

'response' or 'link'

xvals

A numeric vector of values at which to calculate predictions or marginal effects, if x is numeric. By default, it is calculated from the data using seq_range. If x is a factor, this is ignored, as is n.

vcov

the variance-covariance matrix used to calculate confidence intervals

what

The quantity to plot: 'prediction', 'effect', 'classprediction', or 'stackedprediction'

zvar

name of the third dimension variable over which quantities should be plotted (as facets).

zvals

discrete values of the z variable over which to plot

...

Additional arguments such as colour, linetype, size, shape, fill, alpha. These will be passed to ggplot2 geom functions to alter the style of the plot. If 'x' is a factor, these arguments will be passed to geom_pointrange. If 'x' is numeric, these arguments will be passed to geom_line and geom_ribbon. The alpha and fill arguments are not passed to geom_line. The colour argument is not passed to geom_ribbon.


vincentarelbundock/marginsplot documentation built on May 30, 2020, 12:07 a.m.