需要帮助在 R 中使用 Wordfish 编写偏好达到分析代码

问题描述 投票:0回答:1

我想对我的论文进行偏好达到分析。更具体地说,我想调查一下欧盟委员会的碳边界调整机制提案在多大程度上纳入了不同类型利益集团的政策偏好。我收集了大约 160 份立场文件,这些文件是由利益团体在公众咨询期间提交的。我对 R 比较陌生,而且不熟练。幸运的是,我得到了类似研究设计的代码。我不明白这段复制代码的来龙去脉,但我知道它也应该对我的研究进行最小的调整。然而,我遇到了一些无法解决的问题,我真诚地希望 Stackoverflow 社区能够帮助我摆脱这个令人沮丧的僵局。我查阅了互联网和 ChatGPT 上的资源,但在进行偏好达到分析和 Wordfish 方面找不到太多帮助。

这些是我遇到的错误:

  1. 尝试运行“库(xlsx)”时,出现以下错误:错误:“xlsx”的包或命名空间加载失败: .onLoad 在“rJava”的 loadNamespace() 中失败,详细信息: 调用:inDL(x, as.逻辑(本地), as.逻辑(现在), ...) 错误:无法加载共享对象'C:/Users/MR-Az/AppData/Local/R/win-library/4.2/rJava/libs/x64/rJava.dll': LoadLibrary 失败:找不到给定的模块。

采取的措施 ---> 我已经下载了 rJava 64 位,但安装后我不断收到错误:R 会话由于致命错误而中止。我该如何解决这个错误?

  1. 运行以下代码时:'dtm <- dfm(corpus.sub, remove = stopwords("en"), stem = TRUE, remove_punct = TRUE, remove_numbers= TRUE, remove_symbols = TRUE, remove_url = TRUE)' I get the following warning: Warning: 'dfm.corpus()' is deprecated. Use 'tokens()' first.Warning: '...' should not be used for tokens() arguments; use 'tokens()' first.Warning: 'remove' is deprecated; use dfm_remove() insteadWarning: 'stem' is deprecated; use dfm_wordstem() instead

采取的行动 --> 我真的不知道如何解决这个问题。

  1. 运行以下代码时:'example.2 <- textmodel_wordfish(dtmcut, dir=c(82,83), dispersion = "poisson", sparse=TRUE) summary (example.2) positions <- as.data.frame(summary(example.2)) # extract ID texts+theta+se from example 2 textplot_scale1d(example.2)' I get the following error: Warning: Warning: The algorithm did not converge. I also get the following error: Error in textmodel_wordfish.dfm(x = dtmcut, dir = c(82, 83), dispersion = "poisson", : could not find function "textmodel_wordfish.dfm".

采取的操作 --> 我尝试在模型中设置稀疏 = TRUE,但没有帮助。此外,我想知道如何确定 dir =c()? 的范围?通过这段代码,我想从立场文件中提取 theta 和 se,但在输出表中所有值都是 NaNs

从本质上讲,我想我想将 theta 和 se 与委员会提案的 theta 和 se 进行比较,然后根据它们与委员会提案的价值观的差距将论文定位为“赢家”或“输家”。

非常感谢任何帮助或建议!

r xlsx quanteda rjava
1个回答
0
投票

我目前正在撰写关于利益集团对欧盟可再生能源指令 III 的政策形成阶段的影响的论文,并且也遇到了与您遇到的相同问题。虽然我帮不上忙(你也在 10 个月前发布了这篇文章,所以我希望你能为你的论文做出一些贡献),但如果你能分享你的方法和发现,我将永远感激不已!谢谢你。

© www.soinside.com 2019 - 2024. All rights reserved.