Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bplot.xy

Boxplots for conditional distribution


Description

Draws boxplots for y by binning on x. This gives a coarse, but quick, representation of the conditional distrubtion of [Y|X] in terms of boxplots.

Usage

bplot.xy(x, y, N = 10, breaks = pretty(x, N, eps.correct = 1), plot=TRUE,
         ...)

Arguments

x

Vector to use for bin membership

y

Vector to use for constructing boxplot statistics.

N

Number of bins on x. Default is 10.

breaks

Break points defining bin boundaries. These can be unequally spaced.

plot

If FALSE just returns a list with the statistics used for plotting the box plots, bin centers, etc. – More stuff than you can imagine!

...

Any other optional arguments passed to the standard boxplot function.

See Also

bplot, draw.bplot

Examples

# condition on swim times to see how run times vary
bplot.xy( minitri$swim, minitri$run, N=5)

# bivariate normal corr= .8
set.seed( 123)
x<-rnorm( 2000)
y<- .8*x +  sqrt( 1- .8**2)*rnorm( 200)
#
bplot.xy(x,y)
#
bplot.xy( x,y, breaks=seq( -3, 3,,25) ,
                xlim =c(-4,4), ylim =c(-4,4), col="grey80", lwd=2)
points( x,y,col=3, cex=.5)

fields

Tools for Spatial Data

v11.6
GPL (>= 2)
Authors
Douglas Nychka [aut, cre], Reinhard Furrer [aut], John Paige [aut], Stephan Sain [aut], Florian Gerber [aut], Matthew Iverson [aut], University Corporation for Atmospheric Research [cph]
Initial release
2020-10-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.