各位大大,在处理panel数据的时候,当需要同时time-fixed effect 以及state-fixed effect的时候,使用streg与areg的区别是什么呢?
就是数据由主要的两个binary variable:state以及year,以简单的reg为例
xi: xtreg y x i.year, fe vce(cluster state)
xi: areg y x i.state, cluster(state)
因为我用这数据然后跑了这两个命令发现结果一样,所以想问一下这两个命令的主要区别是什么呢?
摘自help areg里的一段话
areg fits a linear regression absorbing one categorical factor. areg is
designed for datasets with many groups, but not a number of groups that
increases with the sample size. See the xtreg, fe command in [XT] xtreg
for an estimator that handles the case in which the number of groups
increases with the sample size.
我的理解是areg适合分类变量的数量不会随着样本数量改变而改变的数据,而xtreg相反