dfbhist: Hybrid Plot for DFBETAS

View source: R/effective_functions.r

dfbhistR Documentation

Hybrid Plot for DFBETAS

Description

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.

Usage

dfbhist(
  data,
  varname,
  label,
  cutval = 0.25,
  binwidth = 0.025,
  xlab = "DFBETAS",
  ylab = "Frequency",
  xrange = NULL,
  yrange = NULL,
  nudge_x = NULL,
  nudge_y = NULL
)

Arguments

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.

Value

A ggplot.

Examples


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")


psre documentation built on Aug. 8, 2022, 5:05 p.m.

Related to dfbhist in psre...