QRdiagnostics | R Documentation |
For a given predictor, create a qq-plot if continuous, or a spinogram if categorical.
QRdiagnostics(X, varname, u_i, qn, plot.it = TRUE, filename = NULL)
X |
A predictor included in the regression. |
varname |
The predictor's name (for plotting). |
u_i |
The QR residuals. |
qn |
The quantile used in the regression. |
plot.it |
Boolean, if TRUE, will show the histogram of the residuals and the fitted kernel density estimate (default=TRUE). |
filename |
The pdf file to save the plot. Default is NULL (print to the screen.) |
A list, as follows, plus the marginal deviance:
For a continuous predictor, the list is called qqp and contains the output from qqplot().
For a categorical variable, the list is called qqlvl, and it contains the empirical percentages of points below the regression line, for each level.
data(simdf) qremFit <- QREM(lm,linmod=y~x*x2 +x3, df=simdf, qn=0.2) qrdg <- QRdiagnostics(simdf$x, "x",qremFit$ui, 0.2, plot.it = TRUE) qrdg <- QRdiagnostics(simdf$x3, "x3",qremFit$ui, 0.2, plot.it = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.