Learn R Programming

plot3logit (version 3.2.0)

autoplot.Hfield3logit: Create a gg3logit plot with field and confidence regions

Description

autoplot() creates a gg3logit plot and adds a field and its confidence regions. autoplot() is a wrapper for gg3logit() and stat_3logit().

Usage

# S3 method for Hfield3logit
autoplot(
  object,
  ...,
  mapping_field = aes(),
  mapping_conf = aes(),
  data = NULL,
  params_field = list(),
  params_conf = list(),
  show.legend = NA,
  conf = TRUE
)

Value

Object of class ggplot.

Arguments

object

an object of class field3logit or multifield3logit.

...

other arguments passed to specific methods

mapping_field, mapping_conf

aesthetic mappings passed to argument mapping of stat_field3logit() and stat_conf3logit().

data

a field3logit object, a multifield3logit object, or a data.frame structured like a fortified field3logit or a multifield3logit object.

params_field, params_conf

graphical parameters passed to argument mapping of stat_field3logit() and stat_conf3logit().

show.legend

logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes. It can also be a named logical vector to finely select the aesthetics to display. To include legend keys for all levels, even when no data exists, use TRUE. If NA, all levels are shown in legend, but unobserved levels are omitted.

conf

if TRUE and if confidence regions are available, the layer of stat_conf3logit() is added, otherwise only a gg3logit() object with the layer of stat_field3logit() is returned.

See Also

Other gg functions: gg3logit(), stat_3logit(), stat_conf3logit(), stat_field3logit()

Examples

Run this code
# \donttest{
data(cross_1year)

mod0 <- nnet::multinom(employment_sit ~ gender + finalgrade, data = cross_1year)
field0 <- field3logit(mod0, 'genderFemale', conf = 0.95)

autoplot(field0)
# }

Run the code above in your browser using DataLab