如何在 rdrobust 中手动选择带宽?

发布于 2025-01-18 13:23:53 字数 447 浏览 3 评论 0原文

我正在使用带有胜利余量的选举数据框架作为我的运行变量,我想在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

短暂陪伴 2025-01-25 13:23:53

我相信简单地指定 .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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文