Learn R Programming

psvmSDR (version 3.0.1)

plot.psdr: Plot sufficient predictors from a psdr object

Description

Produces scatter plots of the sufficient predictors obtained from psdr(). For continuous responses, the function plots Y versus each selected sufficient predictor along with an optional lowess curve. For binary responses, a two-dimensional scatter plot of the first two sufficient predictors is produced with class-specific point colors.

Additional graphical parameters may be passed to the underlying plot() function. The plot is intended as a diagnostic tool to visualize the estimated central subspace and assess how well the sufficient predictors capture the relationship between X and Y.

Usage

# S3 method for psdr
plot(
  x,
  ...,
  d = 1,
  lowess = TRUE,
  col = NULL,
  line.col = "red",
  pch = 16,
  lwd = 1.2,
  xlab = NULL,
  ylab = NULL
)

Value

A scatter plot with sufficient predictors and the lowess curve is overlayed as default.

Arguments

x

object from the function psdr()

...

Additional graphical parameters passed to plot().

d

number of sufficient predictors. Default is 1.

lowess

draw a locally weighted scatterplot smoothing curve. Default is TRUE.

col

color vector for points (optional; defaults depend on response type)

line.col

color for lowess smoothing line (default = "red")

pch

plotting character (default = 16)

lwd

line width for smoothing curve (default = 1.2)

xlab

label for x-axis (default depends on d)

ylab

label for y-axis (default depends on response type)

Author

Jungmin Shin, c16267@gmail.com, Seung Jun Shin, sjshin@korea.ac.kr, Andreas Artemiou artemiou@uol.ac.cy

See Also

psdr_bic, psdr

Examples

Run this code
# \donttest{
set.seed(1)
n <- 200; p <- 5;
x <- matrix(rnorm(n*p, 0, 2), n, p)
y <-  x[,1]/(0.5 + (x[,2] + 1)^2) + 0.2*rnorm(n)
obj <- psdr(x, y)
plot(obj)
# }

Run the code above in your browser using DataLab