Learn R Programming

RobustAFT (version 1.4-7)

plot.fits.compare: Plot Method for "fits.compare" objects

Description

Comparative plots for objects of class "fits.compare".

Usage

# S3 method for fits.compare
plot(x, xplots = FALSE, ask = TRUE, which = 1:4, 
             leg.position = c("topleft", "topleft", "topleft"), ...)

Arguments

x

An object of class "fits.compare", usually, a result of a call to fits.compare.

xplots

If xplots=TRUE, plots of the independent variables versus the residuals are produced.

ask

If ask=TRUE, plot.fits.compare() operates in interactive mode.

which

If a subset of the plots is required, specify a subset of the numbers 1:4.

leg.position

A vector of character string specifying the legend position of the second, third and fourth plots.

...

Optional arguments for par.

Details

For clarity reasons, at most three models should be compared. Four default plots (selectable by which) are produced: histograms of the residuals of each model, a residual Q-Q plot, response against fitted values and residuals against fitted values. Additional plots are produced if xplots=TRUE.

See Also

fits.compare, plot.default, plot.TML

Examples

Run this code
if (FALSE) {
     data(D243)
     Cost <- D243$Cost                             # Cost (Swiss francs)
     LOS  <- D243$LOS                              # Length of stay (days)
     Adm  <- D243$Typadm; Adm <- (Adm==" Urg")*1   # Type of admission 
                                                   # (0=on notification, 1=Emergency)

     lwrob <- TML.noncensored(log(Cost)~log(LOS)+Adm, errors="logWeibull")
     reg   <- lm(log(Cost)~log(LOS)+Adm)

     comp  <- fits.compare(least.squares=reg, TML.logWeibull=lwrob)
     plot(comp, leg.position=c("topleft", "topleft", "bottomleft"), xplots=TRUE)
}

Run the code above in your browser using DataLab