Learn R Programming

SortedEffects (version 1.0.0)

Subpopplot: Plot 2-dimensional projections of variables in interest.

Description

Subpopplot takes output from Subpop command as inputs and plots 2-dimensional projection plots of two specified variables. A factor variable has to be put on the y-axis, otherwise the code breaks. The users need to specify the two variables for the projection with varx and vary, and output should be specified as the output of Subpop.

Usage

Subpopplot(varx, vary, output, xlim = NULL, ylim = NULL, main = NULL,
  sub = NULL, xlab = NULL, ylab = NULL)

Arguments

varx

Variable to be plotted on the x-axis.

vary

Variable to be plotted on the y-axis. If a variable in interest is of type factor, then user must put it on the y-axis.

output

Output of Subpop command.

xlim

x-axis limits. Default is range(data[, varx])

ylim

y-axis limits. Default is NULL.

main

Main title of the plot. Default is NULL.

sub

Sub title of the plot. Default is NULL.

xlab

x-axis label. Default is NULL.

ylab

y-axis label. Default is NULL.

Examples

Run this code
# NOT RUN {
data("mortgage")
fm <- deny ~ black + p_irat + hse_inc
result <- Subpop(fm = fm, data = mortgage, var.T = "black", method = "logit")
Subpopplot(varx = mortgage$p_irat, vary = mortgage$ccred, output = result)

# }

Run the code above in your browser using DataLab