plot.subpop | R Documentation |
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.
## S3 method for class 'subpop' plot( x, varx, vary, xlim = NULL, ylim = NULL, main = NULL, sub = NULL, xlab = NULL, ylab = NULL, overlap = FALSE, ... )
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. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.