plot.subpop {SortedEffects} | R Documentation |
Plot 2-dimensional projections of variables in interest.
Description
Takes output from subpop
command as inputs and plots
2-dimensional projection plots of two specified variables. If a
variable in interest is of type factor, then the user must put it on
the y-axis. If the variable on the y-coordinate is a factor, range of
y-axis is set to be the factor level. Otherwise, users can use
summary.subpop
to know the ranges of variables in the
two groups.
Usage
## S3 method for class 'subpop'
plot(
x,
varx,
vary,
xlim = NULL,
ylim = NULL,
main = NULL,
sub = NULL,
xlab = NULL,
ylab = NULL,
overlap = FALSE,
...
)
Arguments
x |
Output of |
varx |
The name of the variable to be plotted on the x-axis. |
vary |
The name of the variable name to be plotted on the y-axis. |
xlim |
The range of x-axis. Default is |
ylim |
The range of y-axis. Default is |
main |
Main title of the plot. Default is |
sub |
Sub title of the plot. Default is NULL. |
xlab |
x-axis label. Default is |
ylab |
y-axis label. Default is |
overlap |
Whether user wants to allow observations included in both
confidence sets. Default is |
... |
Graphics parameters to be passed to the plotting routines. |
Examples
data("mortgage")
### Regression Specification
fm <- deny ~ black + p_irat + hse_inc + ccred + mcred + pubrec +
ltv_med + ltv_high + denpmi + selfemp + single + hischl
### Issue the subpop command
set_b <- subpop(fm, data = mortgage, method = "logit", var = "black",
u = 0.1, alpha = 0.1, b = 50)
### Plotting
plot(set_b, varx = mortgage$p_irat, vary = mortgage$hse_inc,
xlim = c(0, 1.5), ylim = c(0, 1.5), xlab = "Debt/Income",
ylab = "Housing expenses/Income", overlap = TRUE)