r - R twang 包的 mnps 函数显示绝对标准差图的警告错误
问题描述
我有一个包含 3465 个观察值和 5 个变量的数据集,如下所示(命名为:数据集)
变量
$ Treat --> factor(3 level: "1", "2", "3")
$ Age --> integer(eg. 24,54,etc.)
$ Mortality --> integer(0=no,1 = 是)
$ LDL --> 整数(例如 200,120,143 等)
$ 吸烟 --> 整数(0=否,1= 是)
我在 twang 包中使用了 mnps 函数来根据治疗来衡量我的观察结果
mnps代码
mnps.dataset <- mnps(treat ~ Age + LDL + Smoking, data = dataset, estimand = "ATE", stop.method = c("es.mean", "ks.mean"), n.trees=3000)
``` ### 绘图###
然后我使用绘图功能来评估加权后的数据平衡。图 1 和图 2 没有问题(每次迭代的治疗平衡,以及治疗的倾向得分分布。)
情节代码
plot(mnps.dataset, plots = 1)
plot(mnps.dataset, plots = 2)
但是当我想为绝对标准化差异运行图 3 时,它出现了一些警告和空白图的错误:
警告错误
plot(mnps.dataset, plots = 3)
警告信息:
1: In order(as.numeric(x)) : NAs introduced by coercion
2: In split(as.numeric(x) [ord], gg[ord]) : NAs introduced by coercion
3: ...(same as error 1)
4: ... (same as error 2)
5: ... (same as error 1)
6: ... (same as error 2)
7: ... (same as error 1)
8: ... (same as error 2)
9: In panel.superpose(x, y, type = type, groups = groups, ... : NAs introduced by coercion
10: ...
11: ...
12: ...
___________________
注意:“...”表示重复先前的错误
解决方案
推荐阅读
- html - 滚动捕捉
- php - 调用数组 Laravel Maatwebsite 上的成员函数 chunk()
- reactjs - 没有办法保护 Typescript JSX 上的意外无效标识符(如 kebab-case)吗?
- oracle - 管理代理未将日志上传到 Oracle 云基础设施 (OCI)
- prometheus - Grafana 警报条件函数
- python - 在第一个空行时停止使用 xlrd 从 xls 构建列表
- swift - 从数组中获取最近的元素
- lua - awesomewm - 任务列表图标的大小
- node.js - 如何使用 Express 构建“客户端凭据流”以授权使用 Spotify API?
- c++ - 如何让这个 Linked List Stack 实现在 C++ 中运行?