egen: Convert a continuous variable into groups

View source: R/egen.R

egenR Documentation

Convert a continuous variable into groups

Description

[Deprecated]

This function was deprecated because we realized that it's a special case of the cut function.

Usage

egen(data, var, at = NULL, label = NULL, new_var = NULL, ...)

Arguments

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

See Also

cut

Examples

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")



myominnoo/mStats documentation built on Nov. 29, 2023, 2:36 a.m.