eda_sl | R Documentation |
The eda_sl
function generates a spread-level table from a
univariate dataset.
eda_sl(
dat,
x,
fac,
p = 1,
tukey = FALSE,
sprd = "frth",
plot = TRUE,
grey = 0.6,
pch = 21,
p.col = "grey50",
p.fill = "grey80",
size = 1,
alpha = 0.8
)
dat |
Dataframe |
x |
Continuous variable column |
fac |
Categorical variable column |
p |
Power transformation to apply to variable |
tukey |
Boolean determining if a Tukey transformation should be adopted (FALSE adopts a Box-Cox transformation) |
sprd |
Choice of spreads. Either interquartile, |
plot |
Boolean determining if plot should be generated. |
grey |
Grey level to apply to plot elements (0 to 1 with 1 = black). |
pch |
Point symbol type. |
p.col |
Color for point symbol. |
p.fill |
Point fill color passed to |
size |
Point size (0-1) |
alpha |
Point transparency (0 = transparent, 1 = opaque). Only
applicable if |
Note that this function is not to be confused with William Cleveland's
spread-location function.
If fac
is not categorical, the output will produce many or all NA's.
On page 59, Hoaglan et. al define the fourth-spread as the the range
defined by the upper fourth and lower fourth. The eda_lsum
function is used
to compute the upper/lower fourths.
Returns a dataframe of level and spreads.
Understanding Robust and Exploratory Data Analysis, Hoaglin, David C., Frederick Mosteller, and John W. Tukey, 1983.
dat <- read.csv("http://mgimond.github.io/ES218/Data/Food_web.csv")
sl <- eda_sl(dat, mean.length, dimension)
# The output can be passed to a model fitting function like eda_lm
# The output slope can be used to help identify a power transformation
eda_lm(sl, Level, Spread)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.