Graph 带分类变量的grqreg

Graph 带分类变量的grqreg,graph,error-handling,regression,stata,quantile,Graph,Error Handling,Regression,Stata,Quantile,我正在使用SSC命令-grqreg-为我的方程绘制分位数回归图。我已经能够成功地绘制单个方程;然而,我现在尝试将样本和估计分开。代码和错误如下所示: 我假设发生此错误是因为当模型被拆分时,其中一个内容指示器没有观察结果。我应该如何对此进行故障排除?即使varlist排除了指示符变量,也会发生错误。这很笨拙,但您只需先删除省略的变量: sysuse auto, clear fvunab rhs: weight length i.f* i.rep* xi: qreg price `rhs' if

我正在使用SSC命令
-grqreg-
为我的方程绘制分位数回归图。我已经能够成功地绘制单个方程;然而,我现在尝试将样本和估计分开。代码和错误如下所示:


我假设发生此错误是因为当模型被拆分时,其中一个内容指示器没有观察结果。我应该如何对此进行故障排除?即使varlist排除了指示符变量,也会发生错误。

这很笨拙,但您只需先删除省略的变量:

sysuse auto, clear
fvunab rhs: weight length i.f* i.rep* 
xi: qreg price `rhs' if foreign == 1

/* remove any variables prefixed with o. and the constant */
matrix list e(b)
local rhs2: colnames e(b)
di "`coefs'"
local rhs2 =  ustrregexra("`rhs2'","o\._I[a-zA-Z_0-9]+ ","") 
local rhs2 =  ustrregexra("`rhs2'","_cons","") 

/* Fit the model again with non-omitted variable set */
qreg price `rhs2' if foreign == 1
grqreg, cons ci ols olsci
请注意,在不同场合告诉别人被认为是礼貌的