想要把ROE这一连续变量转化为指示变量,其中0<roe<0.01的,定义新变量information=1,否则information=0,
采用的具体命令如下:
generate information=1 if 0<roe<0.01
replace information=0 if roe<0
replace information=1 if roe>0.01
然后出现的问题是:
采用count if information==1
结果是 145
但是 count if 0<roe<0.01
结果是504
为什么会存在这么大的差异,按理说应该一样啊,能否有高手帮忙回答一下