egen | R Documentation |
This function was deprecated because we realized that it's
a special case of the cut
function.
egen(data, var, at = NULL, label = NULL, new_var = NULL, ...)
data |
data.frame |
var |
existing variable |
at |
either a number or a numeric vector |
label |
Labels for the groups |
new_var |
Name of the new variable |
... |
Additional arguments to be passed to |
cut
data <- data.frame(x = 1:10)
egen(data, x, at = c(3, 7), label = c("low", "medium", "high"))
egen(data, x, at = c(3, 7), label = c("low", "medium", "high"), new_var = "group")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.