to01 | R Documentation |
to01 - function to convent any variable to the [0,1] range
to01(x, na.rm = TRUE, squeeze = FALSE, prior = 0.5, type = "both")
x |
A numeric vector. |
na.rm |
Logical, should missing data be excluded when calculating min/max |
prior |
Numeric, a prior probability for squeezing from [0,1] to (0,1) where the square bracket indicates inclusion of endpoints and parentheses excludes the endpoints. See the references. |
type |
Character. Options are "both" which squeezes from [0,1] to (0,1), "floor" which squeezes from [0,1] to (0,1], and "ceiling" which squeezes from [0,1] to [0,1). |
Stephen Tueller Stueller@rti.org
Smithson, M., & Verkuilen, J. (2006). A better lemon squeezer? Maximum-likelihood regression with beta-distributed dependent variables. Psychological Methods, 11(1), 54.
set.seed(4269)
x <- rnorm(100)
summary(to01(x))
summary(to01(x, squeeze=TRUE))
summary(to01(x, squeeze=TRUE, type="floor"))
summary(to01(x, squeeze=TRUE, type="ceiling"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.