假设因变量y,自变量x,处理变量treat,控制变量(协变量)为controls,求得的权重为_webal,数据为非平衡面板数据包含不同上市公司(stkcd)各年份(year)的数据,因变量为01变量,采用固定xtlogit回归:
ebalance treat controls , targets(3) // 求出权重
xtlogit y x controls [iweight=_webal] , fe nolog // 进行xtlogit回归,此步骤存在问题,报错提示:weights must be the same for all observations in a group(组中所有观测值的权重必须相同)。于是剔除掉fe,进行xtlogit回归,仍报错:weight must be constant within stkcd,也即是说,个体的权重必须统一。这在面板数据中如何实现呢?