Last data update: 2014.03.03

R: Plot Diagnostics for an BAS Object
plot.basR Documentation

Plot Diagnostics for an BAS Object

Description

Four plots (selectable by 'which') are currently available: a plot of residuals against fitted values, Cumulative Model Probabilities, log marginal likelihoods versus model dimension, and marginal inclusion probabilities.

Usage

## S3 method for class 'bas'
plot(x, which=c(1:4),caption = c("Residuals vs Fitted",
                 "Model Probabilities", "Model Complexity",
                 "Inclusion Probabilities"),
                 panel = if (add.smooth) panel.smooth
                 else points, sub.caption = NULL, main = "", ask =
                 prod(par("mfcol")) < length(which) &&
                 dev.interactive(), ..., id.n = 3, labels.id =
                 names(residuals(x)), cex.id = 0.75, add.smooth =
                 getOption("add.smooth"), col.smooth=2,label.pos = c(4, 2))

Arguments

x

bas BMA object result of 'bas'

which

if a subset of the plots is required, specify a subset of the numbers '1:4'

.

caption

captions to appear above the plots

panel

panel function. The useful alternative to 'points', 'panel.smooth' can be chosen by 'add.smooth = TRUE'

sub.caption

common title-above figures if there are multiple; used as 'sub' (s.'title') otherwise. If 'NULL', as by default, a possible shortened version of deparse(x$call) is used

main

title to each plot-in addition to the above 'caption'

ask

logical; if 'TRUE', the user is asked before each plot, see 'par(ask=.)'

...

other parameters to be passed through to plotting functions

id.n

number of points to be labelled in each plot, starting with the most extreme

labels.id

vector of labels, from which the labels for extreme points will be chosen. 'NULL' uses observation numbers

cex.id

magnification of point labels.

add.smooth

logical indicating if a smoother should be added to most plots; see also 'panel' above

col.smooth

color passed to 'panel' function

label.pos

positioning of labels, for the left half and right half of the graph respectively, for plots 1-3

Details

This provides a panel of 4 plots: the first is a plot of the residuals versus fitted values under BMA. The second is a plot of the cumulative marginal likelihoods of models; if the model space cannot be enumerated then this provides some indication of whether the probabilities are leveling off. The third is a plot of log marginal likelihood versus model dimension and the fourth plot show the posterior marginal inclusion probabilities.

Author(s)

Merlise Clyde, based on plot.lm by John Maindonald and Martin Maechler

See Also

plot.coef.bma and image.bas.

Examples

data(Hald)
hald.gprior =  bas.lm(Y~ ., data=Hald, prior="g-prior", alpha=13,
                      modelprior=beta.binomial(1,1),
                      initprobs="eplogp")

plot(hald.gprior)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BAS)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BAS/plot.bma.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.bas
> ### Title: Plot Diagnostics for an BAS Object
> ### Aliases: plot.bas
> ### Keywords: regression
> 
> ### ** Examples
> 
> data(Hald)
> hald.gprior =  bas.lm(Y~ ., data=Hald, prior="g-prior", alpha=13,
+                       modelprior=beta.binomial(1,1),
+                       initprobs="eplogp")
> 
> plot(hald.gprior)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>