Stata:如何从内存中清除sts图形?

时间:2018-08-03 14:45:30

标签: survival stata

我有以下代码:

graph drop _all
sts graph if year==2014, saving(14)
sts graph if year==2015, saving(15)
sts graph if year==2016, saving(16)

gr combine 14.gph 15.gph 16.gph

我想添加一行以清除内存中的上一张图或将其重写。

我尝试过:图表_all。这行不通。图形不会清除。 我还尝试过在上面的代码后放置一个replace命令,如下所示:

sts graph if year==2014, saving(14) replace
sts graph if year==2015, saving(15) replace
sts graph if year==2016, saving(16) replace

gr combine 14.gph 15.gph 16.gph

但是sts不能与replace一起使用。

还有其他建议吗?

1 个答案:

答案 0 :(得分:2)

从手册:

enter image description here

replace选项应该放在一对括号内。试试这个:

sts graph if year==2014, saving(14, replace) 
sts graph if year==2015, saving(15, replace)
sts graph if year==2016, saving(16, replace)
相关问题