Title: | Scatter Plots Over-Viewed Using Summary Ellipses |
---|---|
Description: | Summary ellipses superimposed on a scatter plot contain all bi-variate summary statistics for regression analysis. Furthermore, the outer ellipse flags potential outliers. Multiple groups can be compared in terms of centers and spreads as illustrated in the examples. |
Authors: | Siddhanta Phuyal [aut, cre], Mamunur Rashid [aut], Jyotirmoy Sarkar [aut] |
Maintainer: | Siddhanta Phuyal <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-12-16 06:42:39 UTC |
Source: | CRAN |
Summary ellipses superimposed on a scatter plot contain all bi-variate summary statistics for regression analysis. Furthermore, the outer ellipse flags potential outliers. Multiple groups can be compared in terms of centers and spreads as illustrated in the examples.
summaryEllipse( data1, data2, InEllipse = TRUE, OutEllipse = TRUE, InRect = TRUE, OutRect = TRUE, xlab = "X", ylab = "Y", main = "Summary Ellipse", coverage = 0.98, add = FALSE, wspace = 0.2, REGyonx = TRUE, REGxony = TRUE, ylim = c(min(data2) - wspace * (max(data2) - min(data2)), max(data2) + wspace * (max(data2) - min(data2))), xlim = c(min(data1) - wspace * (max(data1) - min(data1)), max(data1) + wspace * (max(data1) - min(data1))), pch = 1, cex = 0.7, col = "black" )
summaryEllipse( data1, data2, InEllipse = TRUE, OutEllipse = TRUE, InRect = TRUE, OutRect = TRUE, xlab = "X", ylab = "Y", main = "Summary Ellipse", coverage = 0.98, add = FALSE, wspace = 0.2, REGyonx = TRUE, REGxony = TRUE, ylim = c(min(data2) - wspace * (max(data2) - min(data2)), max(data2) + wspace * (max(data2) - min(data2))), xlim = c(min(data1) - wspace * (max(data1) - min(data1)), max(data1) + wspace * (max(data1) - min(data1))), pch = 1, cex = 0.7, col = "black" )
data1 |
explanatory variable; numeric vector x |
data2 |
response variable; numeric vector y |
InEllipse |
LOGICAL; True (Default) for showing the inner ellipse |
OutEllipse |
LOGICAL; TRUE (Default) for showing the outer ellipse |
InRect |
LOGICAL; TRUE (Default) for showing the inner rectangle |
OutRect |
LOGICAL; TRUE (Default) for showing the outer rectangle |
xlab |
x-variable label |
ylab |
y-variable label |
main |
Main title of the plot. |
coverage |
the percentage of data that falls inside the outer ellipse |
add |
adds a summary ellipse of a new data set to an existing plot. Compares multiple groups. |
wspace |
the amount of white space around the plot window; negative to suppress details around the boundaries (zoom in); positive to zoom out. Default is 0.2. |
REGyonx |
LOGICAL; TRUE (Default) for showing the regression line of y on x. |
REGxony |
LOGICAL; TRUE (Default) for showing the regression line of x on y. |
ylim |
bounds for the y-axis |
xlim |
bounds for the x-axis |
pch |
display symbols for the points in the scatter plot; Use different pch for different groups. |
cex |
size of the points |
col |
color of the points |
A new plot which shows the ellipses superimposed on top of each other.
x1<-iris3[,"Sepal L.","Setosa"] y1<-iris3[,"Sepal W.","Setosa"] x2<-iris3[,"Sepal L.","Versicolor"] y2<-iris3[,"Sepal W.","Versicolor"] x3<-iris3[,"Sepal L.","Virginica"] y3<-iris3[,"Sepal W.","Virginica"] xlim=c(4,8) ylim=c(1.5,5) summaryEllipse(x1,y1,xlim=xlim,ylim=ylim,InEllipse='F',InRect='F', OutRect='F',REGxony='F',REGyonx='F') summaryEllipse(x2,y2,add=TRUE,pch=20,col="brown",InEllipse='F',InRect='F', OutRect='F',REGxony='F',REGyonx='F') summaryEllipse(x3,y3,add=TRUE,pch=19,col="grey",InEllipse='F',InRect='F', OutRect='F',REGxony='F',REGyonx='F') #end of example
x1<-iris3[,"Sepal L.","Setosa"] y1<-iris3[,"Sepal W.","Setosa"] x2<-iris3[,"Sepal L.","Versicolor"] y2<-iris3[,"Sepal W.","Versicolor"] x3<-iris3[,"Sepal L.","Virginica"] y3<-iris3[,"Sepal W.","Virginica"] xlim=c(4,8) ylim=c(1.5,5) summaryEllipse(x1,y1,xlim=xlim,ylim=ylim,InEllipse='F',InRect='F', OutRect='F',REGxony='F',REGyonx='F') summaryEllipse(x2,y2,add=TRUE,pch=20,col="brown",InEllipse='F',InRect='F', OutRect='F',REGxony='F',REGyonx='F') summaryEllipse(x3,y3,add=TRUE,pch=19,col="grey",InEllipse='F',InRect='F', OutRect='F',REGxony='F',REGyonx='F') #end of example