numtocat.syn | R Documentation |
Selected numeric variables are grouped into factors with ranges selected from the data.
numtocat.syn(data, numtocat = NULL, print.flag = TRUE, cont.na = NULL, catgroups = 5, style.groups = "quantile")
data |
a data frame. |
numtocat |
a vector of numbers or variable names of numeric variables
to be grouped into factors. If |
print.flag |
if TRUE a list of grouped variables is printed. |
cont.na |
a named list that gives the values of the named variables to be
treated as separate categories, often missing values like |
catgroups |
a single integer or a vector of integers indicating the target
number of groups for the variables in numtocat in the same order as numtocat,
or as their relative postions in data. The achieved number of groups may be
different if, for example there are fewer than |
style.groups |
parameter of the function |
A list with the following components:
data |
a data frame with the numeric variables replaced by factors grouped into ranges. |
breaks |
a named list of the breaks used to divide each numeric variable into categories. |
levels |
a named list of the levels for the categories of each numeric variable. |
orig |
a data frame with the original numeric data. |
cont.na |
a named list of the levels for the categorical version of each numeric variable. |
numtocat |
names of the variables changed to categories. |
ind |
positions in data of the variables changed to categories. |
SD2011.cat <- numtocat.syn(SD2011, cont.na = list(income = -8 , unempdur = -8, nofriend = -8)) summary(SD2011.cat$data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.