MyNixOS website logo
Description

Ternary Plots for Trinomial Regression Models.

An implementation of the ternary plot for interpreting regression coefficients of trinomial regression models, as proposed in Santi, Dickson and Espa (2019) <doi:10.1080/00031305.2018.1442368>. Ternary plots can be drawn using either 'ggtern' package (based on 'ggplot2') or 'Ternary' package (based on standard graphics). The package and its features are illustrated in Santi, Dickson, Espa and Giuliani (2022) <doi:10.18637/jss.v103.c01>.

Ternary Plots for Trinomial Regression Models

Presentation

The package permits the covariate effects of trinomial regression models to be represented graphically by means of a ternary plot. The aim of the plots is helping the interpretation of regression coefficients in terms of the effects that a change in regressors’ values has on the probability distribution of the dependent variable. Such changes may involve either a single regressor, or a group of them (composite changes), and the package permits both cases to be handled in a user-friendly way. Theoretical and methodological details are illustrated and discussed in Santi, Dickson, and Espa (2019), whereas a detailed illustration of the package and its features is available in Santi et al. (2022) or in the main vignette of the package (based on Santi et al. 2022).

The package can read the results of both categorical and ordinal trinomial logit regression fitted by various functions (see the next section) and creates a field3logit object which may be represented by means of functions gg3logit and stat_field3logit.

The plot3logit package inherits graphical classes and methods from the package ggtern (Hamilton and Ferry 2018) which, in turn, is based on the package ggplot2 (Wickham 2016).

Graphical representation based on standard graphics is made available through the package Ternary (Smith 2017) by functions plot3logit and TernaryField, and by the plot method of field3logit objects.

See the help of field3logit for representing composite effects and multifield3logit for drawing multiple fields and the presentation vignette plot3logit-overview by typing:

vignette('plot3logit-overview', package = 'plot3logit')

The paper published on Journal of Statistical Software (Santi et al. 2022) is also available as a package vignette (updated):

vignette('plot3logit-main', package = 'plot3logit')

Compatibility

Function field3logit of package plot3logit can read trinomial regression estimates from the output of the following functions:

  • clm and clm2 of package ordinal (ordinal logit regression);
  • mlogit of package mlogit (logit regression);
  • multinom of package nnet (logit regression);
  • polr of package MASS (ordinal logit regression);
  • vgam and vglm of package VGAM (logit regression).

Moreover, explicit estimates can be passed to field3logit(). See the help of the package (type ? 'plot3logit-package') and the help of functions field3logit() and extract3logit() for further details.

An example

Fit a trilogit model by means of package nnet where the student’s employment situation is analysed with respect to all variables in the dataset cross_1year:

data(cross_1year)
library(nnet)
mod0 <- multinom(employment_sit ~ ., data = cross_1year)

The gender effect is analysed by means of a ternary plot which is generated in two steps, however, package plot3logit should be loaded:

library(plot3logit)

Firstly, the vector field is computed:

field0 <- field3logit(mod0, 'genderFemale')

Secondly, the field is represented on a ternary plot, using either gg-graphics:

gg3logit(field0) + stat_field3logit()

or standard graphics:

plot(field0)

References

Hamilton, N. E., and M. Ferry. 2018. “ggtern: Ternary Diagrams Using ggplot2.” Journal of Statistical Software, Code Snippets 87 (3): 1–17. https://doi.org/10.18637/jss.v087.c03.

Santi, F., M. M. Dickson, and G. Espa. 2019. “A Graphical Tool for Interpreting Regression Coefficients of Trinomial Logit Models.” The American Statistician 73 (2): 200–207. https://doi.org/10.1080/00031305.2018.1442368.

Santi, F., M. M. Dickson, G. Espa, and D. Giuliani. 2022. “plot3logit: Ternary Plots for Interpreting Trinomial Regression Models.” Journal of Statistical Software, Code Snippets 103 (1): 1–27. https://doi.org/10.18637/jss.v103.c01.

Smith, M. R. 2017. “Ternary: An R Package for Creating Ternary Plots.” Zenodo.

Wickham, H. 2016. ggplot2: Elegant Graphics for Data Analysis. New York: Springer-Verlag.

Metadata

Version

3.2.0

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows