| varform | R Documentation |
Compares the nine Tukey ladder transformations using histograms with fitted normal curves and reports n, mean, SD, median, range, skewness, kurtosis and Shapiro-Wilk diagnostics.
varform(x = NULL,
vars = NULL,
data = NULL,
by = NULL,
shift = c("none",
"auto"),
bins = "Sturges",
color = NULL,
palette = "default",
alpha = 0.8,
normal_color = "black",
normal_lty = 1,
normal_lwd = 2,
theme = "journal",
size = 10,
file = NULL,
width = 9,
height = 8,
dpi = 300,
show = TRUE,
bg = "white",
digits = 3,
p_digits = 3)
x |
One numeric variable; optional when |
vars |
Optional selection of several numeric variables. |
data |
Data frame or active R4VN data. |
by |
Optional grouping specification. All selected grouping combinations receive their own transformation ladder. |
shift |
Whether to leave nonpositive data unchanged or add the minimum positive shift required for log/reciprocal transformations. |
bins |
Histogram break specification. |
color, palette, alpha |
Histogram appearance. |
normal_color, normal_lty, normal_lwd |
Normal-curve appearance. |
theme, size |
Graph theme and text size. |
file, width, height, dpi, show, bg |
Graph export/display controls. Multiple outputs receive numbered file names. |
digits, p_digits |
Formatting digits. |
The transformation ladder contains cubic, square, identity, square-root, logarithm, inverse square-root, inverse, inverse-square and inverse-cubic transformations. Logarithmic and reciprocal transformations require positive values unless shift = "auto".
An R4VN result object, invisibly.
ghist, normtest
d <- data.frame(weight = c(29,26,13,23,23,25,17,22,17,19,12,26,30,30,18,14,12,26,17,18))
varform(weight, data = d)
varform(vars = vars(weight), data = d, shift = "auto")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.