Learn R Programming

rifreg (version 1.1.0)

plot.rifreg: Plot the coefficients of a rifreg object

Description

Coefficients are plotted for each quantile and each covariate. Specific covariates can be selected and standard errors displayed if desired.

Usage

# S3 method for rifreg
plot(
  x,
  varselect = NULL,
  confidence_level = 0.05,
  vcov = sandwich::sandwich,
  ...
)

Value

a "ggplot" containing the coefficients for each (selected) covariate

Arguments

x

an object of class "rifreg", usually, a result of a call to rifreg with statistic = "quantiles".

varselect

vector of length 1 or more containig the names of the covariates to display.

confidence_level

numeric value between 0 and 1 (default = 0.95) that defines the confidence interval plotted as a ribbon and defined as qnorm(confidence_level/2) * standard error.

vcov

Function to estimate covariance matrix of rifreg coefficients if covariance matrix has not been bootstrapped. Per default, heteroscedasticity-consistent (HC) standard errors are calculated using sandwich. Note: These standard errors do not take the variance introduced by estimating RIF into account.

...

other parameters to be passed to plotting function. See ggplot for further information.

Examples

Run this code

rifreg <- rifreg(
  formula = log(wage) ~ union +
    nonwhite +
    married +
    education +
    experience,
  data = men8385,
  statistic = "quantiles",
  probs = seq(0.1, 0.9, 0.1),
  weights = weights
)

plot(rifreg)

plot(rifreg, varselect = c("age", "unionyes"), confidence_level = 0.1)

Run the code above in your browser using DataLab