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

plot.kde.loctest

Plot for kernel local significant difference regions


Description

Plot for kernel local significant difference regions for 1- to 3-dimensional data.

Usage

## S3 method for class 'kde.loctest'
plot(x, ...)

Arguments

x

object of class kde.loctest (output from kde.local.test)

...

other graphics parameters:

lcol

colour for KDE curve (1-d)

col

vector of 2 colours. Default is c("purple", "darkgreen"). First colour: sample 1>sample 2, second colour: sample 1<sample2.

add

flag to add to current plot. Default is FALSE.

rugsize

height of rug-like plot (1-d)

add.legend

flag to add legend. Default is FALSE.

pos.legend

position label for legend (1-d, 2-d)

add.contour

flag to add contour lines. Default is FALSE (2-d).

alphavec

vector of transparency values for contour (3-d)

and those used in plot.kde

Details

For kde.loctest objects, the function headers are

## univariate
   plot(x, lcol, col, add=FALSE, xlab="x", ylab, rugsize, add.legend=TRUE, 
     pos.legend="topright", ...)
   
   ## bivariate
   plot(x, col, add=FALSE, xlab="x", ylab="y", add.contour=FALSE, 
     add.legend=TRUE, pos.legend="topright", ...)

   ## trivariate 
   plot(x, col, add=FALSE, xlab="x", ylab="y", zlab="z", box=TRUE, axes=TRUE,
     alphavec=c(0.5, 0.5), ...)

Value

Plots for 1-d and 2-d are sent to graphics window. Plot for 3-d is sent to graphics/RGL window.

See Also

Examples

data(air)
air.var <- c("co2","pm10","no")
air <- air[, c("date","time",air.var)]
air2 <- reshape(air, idvar="date", timevar="time", direction="wide")
a1 <- as.matrix(na.omit(air2[, paste0(air.var, ".08:00")]))
a2 <- as.matrix(na.omit(air2[, paste0(air.var, ".20:00")]))
colnames(a1) <- air.var
colnames(a2) <- air.var
loct <- kde.local.test(x1=a1[,c("co2","pm10")], x2=a2[,c("co2","pm10")])
plot(loct)

loct <- kde.local.test(x1=a1, x2=a2)
plot(loct, xlim=c(0,800), ylim=c(0,300), zlim=c(0,300))

ks

Kernel Smoothing

v1.12.0
GPL-2 | GPL-3
Authors
Tarn Duong [aut, cre], Matt Wand [ctb], Jose Chacon [ctb], Artur Gramacki [ctb]
Initial release
2021-02-06

We don't support your browser anymore

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