plot.abe: Plot Function

View source: R/abe.R

plot.abeR Documentation

Plot Function

Description

Plot function for the resampled/bootstrapped version of ABE.

Usage

## S3 method for class 'abe'
plot(
  x,
  type.plot = c("coefficients", "variables", "models", "stability", "pairwise"),
  alpha = NULL,
  tau = NULL,
  variable = NULL,
  type.stability = c("alpha", "tau"),
  pval = 0.01,
  ...
)

Arguments

x

an object of class '"abe"', an object returned by a call to [abe.resampling()]

type.plot

string which specifies the type of the plot. See details.

alpha

values of alpha for which the plot is to be made (can be a vector of length >1)

tau

values of tau for which the plot is to be made (can be a vector of length >1)

variable

variables for which the plot is to be made (can be a vector of length >1)

type.stability

string which specifies the type of stability plot. See details.

pval

significance level to be used to determine a significant deviation from the expected pairwise inclusion frequency under independence (default 0.01). Only relevant if 'type.plot="pairwise"'.

...

Arguments to be passed to methods, such as graphical parameters.

Details

When using 'type.plot="coefficients"' the function plots a histogram of the estimated regression coefficients for the specified variables, alpha(s) and tau(s) obtained from different re-sampled datasets. When the variable is not included in the final model, its regression coefficient is set to zero. When using 'type.resampling="Wallisch2021"' the plot is based on bootstrap, otherwise as specified in 'type.resampling'.

When using type.plot="variables" the function plots a barplot of the relative inclusion frequencies of the specified variables, for the specified values of alpha and tau. When using 'type.resampling="Wallisch2021"' the plot is based on subsampling with sampling proportion equal to 0.5, otherwise as specified in 'type.resampling'.

When using type.plot="models" the function plots a barplot of the relative frequencies of the final models for specified alpha(s) and tau(s). When using 'type.resampling="Wallisch2021"' the plot is based on subsampling with sampling proportion equal to 0.5, otherwise as specified in 'type.resampling'.

When using 'type.plot="stability"' the function plots variable inclusion frequencies for each value of alpha. 'type.stability' specifies if inclusion frequencies should be plotted as a function of alpha (default) or tau.

When using 'type.plot="pairwise"' the function plots a heatmap of differences between observed pairwise inclusion frequencies and the expected pairwise inclusion frequencies under independence. A high value indicates overselection, i.e. the pair of variables is selected together more often than expected under independence. Selection frequencies (in

Author(s)

Rok Blagus, rok.blagus@mf.uni-lj.si

Sladana Babic

Daniela Dunkler

Gregor Steiner

See Also

abe.resampling, summary.abe, pie.abe

Examples

set.seed(1)
n=100
x1<-runif(n)
x2<-runif(n)
x3<-runif(n)
y<--5+5*x1+5*x2+ rnorm(n,sd=5)
dd<-data.frame(y=y,x1=x1,x2=x2,x3=x3)
fit<-lm(y~x1+x2+x3,x=TRUE,y=TRUE,data=dd)

fit.resample<-abe.resampling(fit,data=dd,include="x1",active="x2",
tau=c(0.05,0.1),exact=TRUE,
criterion="alpha",alpha=c(0.2,0.05),type.test="Chisq",
num.resamples=50,type.resampling="Wallisch2021")

plot(fit.resample,type.plot="coefficients",
alpha=0.2,tau=0.1,variable=c("x1","x3"),
col="light blue")

plot(fit.resample,type.plot="variables",
alpha=0.2,tau=0.1,variable=c("x1","x2","x3"),
col="light blue",horiz=TRUE,las=1)

par(mar=c(4,6,4,2))
plot(fit.resample,type.plot="models",
alpha=0.2,tau=0.1,col="light blue",horiz=TRUE,las=1)

fit.resample<-abe.resampling(fit,data=dd,include="x1",active="x2",
tau=c(0.05,0.1),exact=TRUE,
criterion="alpha",alpha=c(0.2,0.05),type.test="Chisq",
num.resamples=50,type.resampling="bootstrap")

plot(fit.resample,type.plot="coefficients",
alpha=0.2,tau=0.1,variable=c("x1","x3"),
col="light blue")

fit.resample<-abe.resampling(fit,data=dd,include="x1",active="x2",
tau=c(0.05,0.1),exact=TRUE,
criterion="alpha",alpha=c(0.2,0.05),type.test="Chisq",
num.resamples=50,type.resampling="subsampling")

plot(fit.resample,type.plot="variables",
alpha=0.2,tau=0.1,variable=c("x1","x2","x3"),
col="light blue",horiz=TRUE,las=1)

par(mar=c(4,6,4,2))
plot(fit.resample,type.plot="models",
alpha=0.2,tau=0.1,col="light blue",horiz=TRUE,las=1)

abe documentation built on April 12, 2025, 1:54 a.m.