组合变量以创建新变量
Combine variables in order to create new one
我需要一个新的可变种族。
我现在拥有的变量:
荷兰语(如果是 = 1,如果否 = 0)
俄语(如果是 = 2,如果否 = 0)
So it looks like that now:
Russian Dutch
2 0
0 1
0 1
2 0
如何将“荷兰语”和“俄罗斯语”变量组合成一个新的“种族”?
我想要这样的结果:
Ethnicity
2
1
1
2
我已经尝试过计算,但没有成功。
simple\basic\generic 方法是:
if dutch=1 ethnicity=1.
if russian=2 ethnicity=2.
但如果我正确理解你的数据结构,这也应该有效:
compute ethnicity=sum(dutch, russian).
我需要一个新的可变种族。 我现在拥有的变量: 荷兰语(如果是 = 1,如果否 = 0) 俄语(如果是 = 2,如果否 = 0)
So it looks like that now:
Russian Dutch
2 0
0 1
0 1
2 0
如何将“荷兰语”和“俄罗斯语”变量组合成一个新的“种族”?
我想要这样的结果:
Ethnicity
2
1
1
2
我已经尝试过计算,但没有成功。
simple\basic\generic 方法是:
if dutch=1 ethnicity=1.
if russian=2 ethnicity=2.
但如果我正确理解你的数据结构,这也应该有效:
compute ethnicity=sum(dutch, russian).