恢复DBL+ lbl变量
我需要录制使用Haven导入的一些变量。 变量标记为DBL+LBL。
0 = [no]
1 = [yes]
我需要将此变量重新描述为
1 = [yes]
2= [no]
我使用的: data_muenster $性别[data_muenster $ gender == 0]< - 2
在这种情况下,当然值正确地重新编码了值,但是我没有2个;有没有办法一次重新编码价值和标签?
I need to recorde some variables I imported using haven.
The variables are dbl+lbl labelled.
0 = [no]
1 = [yes]
I need to recode this variable to
1 = [yes]
2= [no]
I used:data_MUENSTER$gender[data_MUENSTER$gender == 0 ] <- 2
In this case of course the value is recoded correctly, but I have no lable for 2; Is there a way to recoded value and label at once?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够通过
标记的
软件包的某些版本的set_value_labels
来实现此目标。You should be able to achieve this with some version of
set_value_labels
from thelabelled
package.