xttobit srdi rdi tta ds urs ecec gtfp doft pfi ehi iir crp clp ul11 nolog tobit以上是我在stata中已有的模型我需要区分三个地区并建立两个虚拟变量其中第一个地区id为22、23、25、24第二个区域id为17、18、14、第三个区域id为9、10、11、12如何进行赋值以及在stata中实现
首先,需要创建两个虚拟变量。假设这两个变量分别为d1和d2,可以使用以下命令创建:
gen d1 = 0 replace d1 = 1 if inlist(id, 22, 23, 24, 25)
gen d2 = 0 replace d2 = 1 if inlist(id, 14, 17, 18)
接下来,可以使用以下命令来估计模型:
xttobit srdi rdi tta ds urs ecec gtfp doft pfi ehi iir crp clp d1 d2, ul(1.1) nolog
此命令将在模型中包括d1和d2作为虚拟变量,并将区分三个不同的地区。
原文地址: https://www.cveoy.top/t/topic/bpfq 著作权归作者所有。请勿转载和采集!