我很高兴能够对事后清理数据库。我有大约8个二进制分类变量,它们都应该是互斥的。变量正在为患者编写诊断类别,如下所示:
LipDeformity
PalateDeformity
Fistula
NasalDeformity
EarDeformity
OtherDiagnosis
MissingDiagnosis
对于每种情况,其中一个变量应为1,其余变量应为0。我一直试图找出如何检查SPSS语法中的重叠变量,但一直无法找到它。我尝试了DO REPEAT:
DO REPEAT x = LipDeformity LipDeformity LipDeformity LipDeformity LipDeformity LipDeformity
/ y = PalateDeformity Fistula NasalDeformity EarDeformity OtherDiagnosis MissingDiagnosis.
DO IF x=1=y.
COMPUTE OverlappingLipDiagnosis=1.
ELSE.
COMPUTE OverlappingLipDiagnosis=0.
END IF.
但是SPSS将所有内容编码为OverlappingLipDiagnosis = 1。另外,这将是检查每个变量组合的繁琐方法,并且我希望能够最佳地创建一个变量,其中0 =没有2个变量是“1”而1 =(任何)两个变量都是“1”
谢谢!
答案 0 :(得分:1)
试试这个:
compute OverlappingLipDiagnosis=sum(LipDeformity, PalateDeformity, Fistula,
NasalDeformity, EarDeformity, OtherDiagnosis, MissingDiagnosis)>1.