rescale_occupation: Rescale the Eurobarometer occupation variable

Description Usage Arguments Examples

Description

The Eurobarometer occupations have three groups: none-active, self-employed, and employed occupations. If you only need this categorization, you should use the recatogorized version of this variable. The numeric recategorization keeps this grouping, giving numeric representations starting with digit 1 for none-active, 2 for self-employed and 3 for employed respondents. Keeping only the first digit will re-create the recoded version of this variable. The second digit is a unique numeric identifier, but the ordering of the numeric variable, or the differences between numeric codes have little if any meaning. This is a truly categorical variable. The return_class="factor" and return_class="character" give shorthened versions of the GESIS labels for easier handling in R. This is a wrapper function around the rescale_categories function.

Usage

1
2
rescale_occupation(column, from = NULL, to = NULL,
  na_labels = c("default"), return_class = "factor", underscore = TRUE)

Arguments

column

A column from a survey data with the subjective urbanization answers.

from

Defaults to c("NULL") in which case the GESIS coding in English c(..., "Retired, unable to work","Farmer", ...) will be used.

to

Defaults to NULL in which case the GESIS coding will be shortened to c(... "retired", "farmer" ...). If you choose return_class = "numeric" the default to parameter changes to c(0,1,2).

na_labels

Defaults to c("default").

return_class

Default is "factor", alternatives "character" or "numeric".

underscore

Defaults to TRUE in which case factor names or character strings contain underscore_between_words. This is a better approach for further programming, but you can choose FALSE for nicer printing results. See examples.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
rescale_occupation (c("Owner of a shop, craftsmen, etc.",
                      "Retired, unable to work",
                      "Employed position, at desk",
                      "Employed professional (employed doctor, etc.)",
                      "DK"),
                    return_class = "character")

##Nicer printing factor names without underscore:

rescale_occupation (c("Owner of a shop, craftsmen, etc.",
                      "Retired, unable to work","DK"),
                    underscore = FALSE)

##Beware that the numeric representation is grouped but not ordered.

rescale_occupation (c("Owner of a shop, craftsmen, etc.",
                      "Retired, unable to work",
                      "Employed position, at desk",
                      "Employed professional (employed doctor, etc.)",
                      "DK"),
                    return_class = "numeric")

antaldaniel/surveyreader documentation built on May 16, 2019, 2:29 a.m.