原文链接:https://www.lianxh.cn/news/d7c94c7777226.html
目录
合成控制法的常用命令 synth
在使用过程中,可能会出现一些问题,导致命令无法正常运行。本文列出两种经常出现的问题,并给出解决方案。
1. 第一种出现的报错
运行 synth
命令以后,显示无法加载 synthopt.plugin
。
use "smoking.dta",clear xtset state year synth cigsale lnincome age15to24 retprice beer(1984(1)1988) /// cigsale(1988) cigsale(1980) cigsale(1975), /// trunit(3) trperiod(1989) xperiod(1980(1)1988) /// fig nested allopt *===================== 出现下面报错信息 ======================* Could not load plugin: D:\stata15/ado\plus\s\synthopt.plugin (error occurred while loading synth.ado) r(9999);
这是旧版本文件可能存在的问题,如果电脑里面装了多个版本的 synth 命令相关文件,可能会导致错误调用。
解决方案: 使用 ssc install synth, replace
更新 synth 命令。
. ssc install synth, replace *========================== 显示结果如下: ======================== the following files will be replaced: D:\stata15/ado\plus\s\synth.sthlp D:\stata15/ado\plus\s\synthopt.plugin installing into D:\stata15/ado\plus\... installation complete.