help heckman,看里面select的详细说明,select(varlist_s)或者select(depvar_s = varlist_s)两种形式都可以,第一种形式省略了因变量,默认和结果方程是相同因变量,对省略情况的详细说明是“If depvar_s is not specified, observations for which depvar is not missing are assumed selected, and those for which depvar is missing are assumed not selected.”,意思就是如果省略因变量,则因变量数值为缺失状态的样本为未被选择的样本,如果你的因变量将缺失的都定义为0,如果省略因变量,heckman命令会把这个样本定义为被选择的样本,比如你用CFPS2020中的医疗总费用(metotal)这一变量,CFPS在生成这一变量时就将所有缺失等情况的数值定为0了,所以如果直接使用就会提示dependent variable never censored because of selection。如果是这种类型的原始数据,则需要根据医疗总费用(metotal)的具体数值,生成是否发生医疗费用(ifmed)的虚拟变量,然后用第二种形式select(ifmed = varlist_s)。