flatQQplot: A 'flat QQ-plot' for a fitted quantile regression model.

View source: R/QREM.R

flatQQplotR Documentation

A ‘flat QQ-plot’ for a fitted quantile regression model.

Description

Showing multiple ('flat') QQ plots for different quantiles using a heatmap.

Usage

flatQQplot(
  dat,
  cnum = NULL,
  vname = NULL,
  qrfits,
  qns,
  maxm = 30,
  sdevs = 4,
  filename = NULL,
  plot.it = TRUE
)

Arguments

dat

The data matrix.

cnum

The selected column number.

vname

The selected variable name (if cnum is not specified).

qrfits

A list of QR-fitted models.

qns

The quantiles.

maxm

The maximum number of segments in the partision of the selected variable (default=30)

sdevs

Used to determine the ranges for critical values under the null model and thus the range of colors in the heatmap (default= 4).

filename

The pdf file to save the plot. Default is NULL (print to the screen.)

plot.it

A logical variable used to determine whether to show the diagnostic plot (TRUE).

Examples


data(simdf)
qns <- seq(0.1,0.9,by=0.1)
qrfits <- list()
for (i in 1:length(qns)) {
 qrfits[[i]] <- QREM(lm,linmod=y~x*x2 +x3, df=simdf, qn=qns[i])
}
pvals <- flatQQplot(dat=simdf, cnum = 2, qrfits=qrfits, qns=qns, maxm = 20, plot.it = TRUE)
pvals <- flatQQplot(dat=simdf, cnum = 3, qrfits=qrfits, qns=qns, maxm = 20, plot.it = TRUE)
pvals <- flatQQplot(dat=simdf, cnum = 4, qrfits=qrfits, qns=qns, maxm = 20, plot.it = TRUE)


haimbar/QREM documentation built on Aug. 27, 2022, 7:10 p.m.