Description Usage Arguments Value See Also Examples
Harmonize the numeric values and the value labels of variables. Currently works only with binary values.
1 | harmonize_value_labels(labelled_var, categories = 2)
|
labelled_var |
A vector (survey variable) coded in with labelled class. |
categories |
The number of valid categories in the value range. |
A labelled vector containing harmonized numeric values and
labels, and in attr(v, num_orig)
the original numeric values,
attr(v, labels_orig)
the original labelling.
Other harmonization functions:
eurobarometer_special_values()
1 2 3 4 5 6 7 8 9 10 11 12 13 | v <- labelled::labelled(
c(3,4,4,3,8, 9),
c(YES = 3, NO = 4, wrong_label = 8, refused = 9)
)
harmonize_value_labels(v, 2)
v3 <- labelled::labelled(c(3,4,5,3,8, 9),
c(`BETTER`= 3, `WORSE`= 4,
`SAME` = 5,
wrong_label = 8, refused = 9))
harmonize_value_labels(
labelled_var = v3,categories = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.