我研究的是沪深A股公司2017年-2019年被ST与否对散户持股比例的影响
第一步双重差分用的是固定效应模型,输入命令如下
reg rethold ST i.year i.stkcd,r (rethold为散户持股比例,ST是个体、时间虚拟变量交乘项)
输入指令后显示
maxvar too small
You have attempted to use an interaction with too many levels or attempted to fit a model with too many variables.
You need to increase maxvar; it is currently 5000. Use set maxvar; see help maxvar.
If you are using factor variables and included an interaction that has lots of missing cells, either increase maxvar
or set emptycells drop to reduce the required matrix size; see help set emptycells.
If you are using factor variables, you might have accidentally treated a continuous variable as a categorical,
resulting in lots of categories. Use the c. operator on such variables.
然后换命令为xtreg rethold ST i.year,fr 可以跑出了
但是后边需要做一个三重差分,把价格高低作为虚拟变量再加进去,所以还要继续使用以下命令
reg rethold ST ST#P i.year##i.stkcd,r (P为价格高低虚拟变量)
所以后边还是要用reg的命令,我的数据比较多大概二百多万条,之前看到用set max 但是最多也达不到两百万,所以请问有什么方法吗,或者可以用其他什么回归方法吗?
(没有计量和stata基础,所以很多东西不知道,如果需要学习什么新命令,劳烦留下代码我自己去查,万分感谢!)
数据如下