r - 更改 bal.plot 生成的图例
问题描述
我对可能取 1/0 的因子变量对患者群体进行了倾向性分析
m.out = matchit(MatchedVar ~ Property1+Property2+Property3
, data = PropensityDB, method = "nearest", ratio = 1)
并且想要绘制距离均值的新分布。我通过调用来做到这一点
bal.plot(m.out,var.name = "distance", which = "both")
并得到下图:
我想将“治疗”标题更改为其他名称以正确命名组。
尝试了几种方法,但无法解决这个问题。
有任何想法吗?
解决方案
bal.plot 创建一个可以作为所有 ggplot 对象操作的 ggplot 对象:
p <- bal.plot(m.out,var.name = "distance", which = "both")
p + scale_fill_discrete(name = "MatchedVar")
推荐阅读
- python - 在 python 中使用 selenium 下载后,文件会自动附加 .part
- django - Apache HUE,可以使用 REST API 登录,但其余的不起作用
- ios - Pod 问题 -: Nanaimo::Reader::ParseError - [!] 数组在对象之间缺少 ','
- python - Pycharm 没有找到 PIL 吗?
- android - 带有导航组件的 DrawerLayout:非主页顶级目的地上的汉堡菜单不会加载抽屉
- javascript - Ionic 5 - 如何修改 ion-button expand="block" 宽度
- python - Python混淆矩阵
- sql - How can select all columns except some columns in SQL Server 2017?
- python - Spyder not opening the webcam result window using opencv even code is running
- asp.net-core - ASPNET Core 3.x - Appending data to all API responses