Learn R Programming

plot3logit (version 2.2.0)

stat_3logit: Add a field and confidence regions to a gg3logit plot

Description

stat_3logit() adds a field and its confidence regions to a gg3logit plot. stat_3logit() is a wrapper for stats stat_field3logit() and stat_conf3logit() which are jointly applied.

Usage

stat_3logit(
  mapping_field = aes(),
  mapping_conf = aes(),
  data = NULL,
  params_field = list(),
  params_conf = list(),
  show.legend = NA,
  inherit.aes = TRUE,
  conf = TRUE
)

Arguments

mapping_field, mapping_conf

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

data

a 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.

inherit.aes

If FALSE, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. borders().

conf

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

See Also

Other gg functions: autoplot.field3logit(), gg3logit(), stat_conf3logit(), stat_field3logit()

Examples

Run this code
# NOT RUN {
data(cross_1year)

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

gg3logit(field0) + stat_3logit()
gg3logit(field0) + stat_3logit(conf = TRUE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab