View source: R/effective_functions.r
dfbhist | R Documentation |
Plots a hybrid histogram, dot plot for DFBETAS. A histogram is plotted
for the observations below cutval
. Observations above cutval
are plotted and labelled with individual points.
dfbhist( data, varname, label, cutval = 0.25, binwidth = 0.025, xlab = "DFBETAS", ylab = "Frequency", xrange = NULL, yrange = NULL, nudge_x = NULL, nudge_y = NULL )
data |
A data frame of DFBETAS values |
varname |
The name of the variable to plot |
label |
Name of variable that holds the labels that will go with the points |
cutval |
The value that separates the histogram from the individual points. |
binwidth |
The bin width for the histogram part of the display. |
xlab |
Label to put on the x-axis. |
ylab |
Label to put on the y-axis. |
xrange |
Alternative range to plot on the x-axis. |
yrange |
Alternative range to plot on y-axis |
nudge_x |
Vector of values to nudge labels horizontally. |
nudge_y |
Vector of values to nudge labels vertically. |
A ggplot.
data(wvs) wvs <- na.omit(wvs[,c("country", "secpay", "gini_disp", "democrat")]) lmod <- lm(secpay ~ gini_disp + democrat, data=wvs) dba <- dfbetas(lmod) dbd <- wvs dbd$dfb_ginil <- dba[,2]^2 dbd$dfb_democl <- dba[,3]^2 dfbhist(dbd, "dfb_ginil", "country")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.