如何在 rdrobust 中手动选择带宽?
我正在使用带有胜利余量的选举数据框架作为我的运行变量,我想在rdrobust中手动选择带宽。 我现在应该使用H()命令来为此,但我不明白如何放置两个带宽。
我想要截止两侧的0.10和-0.10。这是我的代码:
llr_outcome2 <- rdrobust::rdrobust(
thesis_no_na$pre_natal,
thesis_no_na$margin_of_victory,
c = 0,
kernel = "tri",
h = c(-0.1, 0.1))
summary(llr_outcome2)
我会收到此错误:rdrobust_kweight(x_l,c,h_l,kernel)中的错误:未找到对象'h_l'
谢谢您的任何帮助::)!
I am using an election data frame with margin of victory as my running variable and I want to manually select the bandwidth in rdrobust.
I now that I should use the h() command for that, but I don't understand how to put two bandwidths.
I want 0.10 and -0.10 in both sides of the cutoff. This is my code:
llr_outcome2 <- rdrobust::rdrobust(
thesis_no_na$pre_natal,
thesis_no_na$margin_of_victory,
c = 0,
kernel = "tri",
h = c(-0.1, 0.1))
summary(llr_outcome2)
and I get this error: Error in rdrobust_kweight(X_l, c, h_l, kernel) : object 'h_l' not found
Thank you for any help :)!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信简单地指定 .1 将自动在截止点周围对称地应用带宽(即,它将在 [-.1, 1] 之间。如果您想要两侧之间不对称截止,则只需要指定两个。
这可能会解决您当前的问题,但更一般地说,我也无法弄清楚如何应用非对称带宽。
I believe simply specifying .1 will automatically apply the bandwidth symmetrically around the cut-off (i.e. it will be between [-.1, 1]. You would only need to specify two if you wanted asymmetric cut-offs between the two sides.
This may solve your current issue, but more generally, I also could not figure out how to apply asymmetric bandwidths.