更改bal.plot生成的图例

问题描述 投票:0回答:1

我对患者人群的因变量进行了倾向分析,其取1/0

m.out = matchit(MatchedVar ~ Property1+Property2+Property3
                , data = PropensityDB, method = "nearest", ratio = 1)

并且要绘制距离均值的新距离分布。我通过致电

来做到这一点
bal.plot(m.out,var.name = "distance", which = "both")

并获得下图:

enter image description here

我想将“处理”标题更改为其他名称以正确命名组。

尝试了几种方法,但无法解决此问题。

有什么想法吗?

r
1个回答
0
投票
bal.plot创建一个ggplot对象,可以将其作为所有ggplot对象进行操作:

p <- bal.plot(m.out,var.name = "distance", which = "both") p + scale_fill_discrete(name = "MatchedVar")

© www.soinside.com 2019 - 2024. All rights reserved.