Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R package matchit:精确匹配规范和错误消息_R - Fatal编程技术网

R package matchit:精确匹配规范和错误消息

R package matchit:精确匹配规范和错误消息,r,R,我正在使用R包matchit进行倾向评分匹配分析 m.out3<-matchit(data=b4psm5, treat~high_school_gpa+male+pell+black+hispanic+asian+other+race_miss,method="nearest", ratio=1,exact=c("cohortid"), m.order="random", caliper=0.25) 你能建议一下吗?我没有可复制的数据集。这可能是因为您在语法中出错。如果公式(带有~的部分

我正在使用R包matchit进行倾向评分匹配分析

m.out3<-matchit(data=b4psm5, treat~high_school_gpa+male+pell+black+hispanic+asian+other+race_miss,method="nearest", ratio=1,exact=c("cohortid"), m.order="random", caliper=0.25)

你能建议一下吗?我没有可复制的数据集。

这可能是因为您在语法中出错。如果公式(带有
~
的部分)不是第一个参数,则需要使用
公式=
标记它。因此,尝试运行以下代码并查看是否出现错误:

m.out3 <- matchit(data = b4psm5, 
                  formula = treat ~ high_school_gpa + male + pell + 
                      black + hispanic + asian + other + race_miss,
                  method="nearest", ratio=1, exact=c("cohortid"), 
                  m.order="random", caliper=0.25)

m.out3这可能是因为您在语法中出错。如果公式(带有
~
的部分)不是第一个参数,则需要使用
公式=
标记它。因此,尝试运行以下代码并查看是否出现错误:

m.out3 <- matchit(data = b4psm5, 
                  formula = treat ~ high_school_gpa + male + pell + 
                      black + hispanic + asian + other + race_miss,
                  method="nearest", ratio=1, exact=c("cohortid"), 
                  m.order="random", caliper=0.25)

m.out3获取数据样本可能会有所帮助。您能否编辑您的问题并添加来自
dput(head(b4msm5))
的输出?(检查该小样本是否存在错误可能会很好。如果没有出现错误,请查找导致错误的行…您自己可能会看到问题。)您好,您需要就堆栈溢出提出问题,干杯。抱歉,返回此问题需要一段时间。获取数据样本可能会有所帮助。您能否编辑您的问题并添加来自
dput(head(b4msm5))
的输出?(检查您是否在小样本中得到了错误可能会很好。如果您没有得到错误,请查找导致错误的行…您自己可能会看到问题。)您好,您需要为堆栈溢出提出问题,干杯。抱歉,需要一段时间才能回到这个问题。嗯,抱歉,它不起作用。我收到了同样的信息。如果我找到解决办法,我会通知你的。我试图生成一个可复制的数据,但是代码没有产生错误。嗯,对不起,它不起作用。我收到了同样的信息。如果我找到解决办法,我会通知你的。我试图制作一个可复制的数据,但是代码没有产生错误。