我很尴尬地问这个问题,因为它看起来很简单,但我无法弄清楚。
我正在尝试基于多个 if-then 语句创建一个新变量。例如:
if question1=1 then newvar=1;
if question2=1 then newvar=2;
if question3=1 and question4=1 then newvar=3;
if question5 in (1 2) then newvar=4;
if question1=2 then newvar=5;
我认为我可能会用每条语句覆盖 newvar ?这是怎么回事?