drawQuantileRegion: Multiple-output Bayesian quantile regression model

View source: R/drawQuantileRegion.R

drawQuantileRegionR Documentation

Multiple-output Bayesian quantile regression model

Description

This function draws plots of the quantile region based on multiple-output quantile regression models.

Usage

drawQuantileRegion(
  model,
  datafile,
  response,
  ngridpoints = 100,
  xValue = 1,
  paintedArea = FALSE,
  comparison = FALSE,
  result_folder = FALSE,
  path_folder = NULL,
  splines_part = FALSE,
  wValue = NULL,
  print_plot = TRUE,
  model_name = "bayesx.estim",
  name_var,
  range_y = NULL,
  lower_q = FALSE,
  upper_q = FALSE,
  lambda_a = NULL,
  ...
)

Arguments

model

This is an object of the class multBQR, produced by a call to the multBayesQR function.

datafile

A data.frame from which to find the variables defined in the formula.

response

Names of response variables

ngridpoints

Number of grid points considered to build this quantile region, where a thorough search will look for the specified region, given the estimates for several directions. Default is 100, that will produce a grid with 10.000 points in the observed range of the data.

xValue

Fixed value of the predictor variables. Default value is 1 when there is only the intercept. If there is the interest in comparing the quantile regions for different values of predictors, it must used with a list of values for the predictors.

paintedArea

If TRUE, it will plot the data points and the quantile region layer over the points, for each tau, in different plots. If FALSE, it will produce one plot showing showing all quantile regions for the different quantiles.

comparison

Only considered when paintedArea = FALSE, if TRUE then it will plot comparisons of quantile regions for different values of xvalue.

result_folder

Logical value determining whether all estimates are stored in a folder produced by a BayesX call. Default is FALSE.

path_folder

If result_folder = TRUE, then one must inform the path where all results are stored.

splines_part

Logical value to indicate whether there are splines terms in the equation to draw the quantile contours.

wValue

Fixed value to be plugged in the spline part of the equation.

print_plot

Logical determining whether plot should be printed or data with coordinantes should be returned. Only checked when paintedArea is FALSE. Default is TRUE.

model_name

When results will be collected in a folder, this should be the name of the name considered by BayesX to save all tables. Default is 'bayesx.estim'.

name_var

When there is a nonlinear variable from which one wants to consider different values for plotting, this should have the name of the variable.

range_y

matrix type object containing in the first line the range for the first dimension and in the second line the range for the second dimension of Y. This will be used to find the respective quantile regions.

lower_q

Logical determining whether quantile region should be based on the lower value of 0.95 credible interval for each parameter of the model.

upper_q

Logical determining whether quantile region should be based on the upper value of 0.95 credible interval for each parameter of the model.

lambda_a

Parameter to be make the adjustment of the intercept to correct the miscoverage of the quantile regions. lower_q must be FALSE for this argument to be checked.

...

Other parameters for summary.multBQR.

Value

A ggplot with the quantile regions based on Bayesian quantile regression model estimates.


brsantos/baquantreg documentation built on Feb. 8, 2023, 8:18 a.m.