Learn R Programming

plot3logit (version 2.2.0)

pc2p0: Computation of starting points of curves of the field

Description

Given the output of DeltaB2pc_cat3logit() or DeltaB2pc_ord3logit(), the coordinates of points on the edge are computed for each curve of the field of points given in input.

Usage

pc2p0(pc, DeltaB, edge = 0.01, flink)

pc2p0_single(pc, DeltaB, w, edge, flink)

Arguments

pc

list of ternary coordinates, as returned by DeltaB2pc_cat3logit() or DeltaB2pc_ord3logit(). Function pc2p0_single accepts only a single point (that is a numeric vector of length three).

DeltaB

either a matrix \(\Delta^TB\in\textbf{R}^{1\times 2}\) or a vector of length 2, if the model is categorical; otherwise a matrix \(\Delta^TB\in\textbf{R}^{1\times 1}\) or a numeric, if the model is ordinal.

edge

width of the border of the ternary plot.

flink

named list of two functions: P2XB and XB2P. The former is the link function, whereas the latter is its inverse.

Value

A named list with two components:

status

a character always equal to "p0" (see section Value of DeltaB2pc()).

pp

a list of ternary coordinates.

Examples

Run this code
# NOT RUN {
library(magrittr)
# For the categorical logit model
depoDeltaB <- c(0.05, 0.08)
plot3logit:::DeltaB2pc_cat3logit(depoDeltaB) %>%
  plot3logit:::pc2p0(depoDeltaB, flink = list(
    P2XB = plot3logit:::P2XB_cat3logit,
    XB2P = plot3logit:::XB2P_cat3logit))

# For the ordinal logit model
depoDeltaB <- 0.08
depoalpha <- c(-0.4, 0.4)
plot3logit:::DeltaB2pc_ord3logit(depoDeltaB, depoalpha) %>%
  plot3logit:::pc2p0(depoDeltaB, flink = list(
    P2XB = function(x) plot3logit:::P2XB_ord3logit(x, depoalpha),
    XB2P = function(x) plot3logit:::XB2P_ord3logit(x, depoalpha)))

# }

Run the code above in your browser using DataLab