r - 如何在一张图中可视化来自不同模型的系数?
问题描述
我有 2 个不同的数据集。我对每一个应用相同的 plm 回归。我想知道如何在同一个图中可视化每个模型的估计系数。
mainstream <- plm(log(sum_plays) ~ cancel_public_events + close_public_transport + internationaltravel + restrictions_on_gatherings + school_closing + stay_at_home_requirements + workplace_closing + new_cases_per_million + new_deaths_per_million +
data = top200, model = "within")
long_tail <- plm(log(sum_plays) ~ cancel_public_events + close_public_transport + internationaltravel + restrictions_on_gatherings + school_closing + stay_at_home_requirements + workplace_closing + new_cases_per_million + new_deaths_per_million +
data = bottom, model = "within")
我可以为每个单独的模型制作图,但是我想把这两个图的信息都放在一个图中。可能按颜色区分系数(即红色的“主流”系数和蓝色的“长尾”系数)
a <- plot_model(long_tail, transform = NULL, show.values = TRUE, value.offset =.3, terms = c("workplace_closing" , "stay_at_home_requirements", "school_closing", "close_public_transport", "internationaltravel", "restrictions_on_gatherings", "cancel_public_events"), title = "Coefficients for Long-Tail Music Consumption")
b <- plot_model(mainstream, transform = NULL, show.values = TRUE, value.offset =.3, terms = c("workplace_closing" , "stay_at_home_requirements", "school_closing", "close_public_transport", "internationaltravel", "restrictions_on_gatherings", "cancel_public_events"), title = "Coefficients for Long-Tail Music Consumption")
解决方案
推荐阅读
- typescript - 是否可以将字符串数组转换为字符串文字联合类型?
- java - Gemfire 的光标等效项?
- javascript - HTML/Js/Css - 选择一个随机元素来改变颜色
- firebase - Firebase 存储安全。为什么我可以复制/粘贴链接到我的文件并在浏览器中打开它们?
- apache-kafka - Kafka Streams KTable-KTable outerJoin 发出 oldValue 而不是 newValue
- python - 使用分组数据的 Python 直方图
- git-lfs - 上传 LFS 对象 - 未找到存储库或对象
- c - 尝试将联合分配给结构中的 void*
- docker - Docker 卷映射:文件未从 Docker linux 容器复制到本地 Windows 机器
- python - 从多个标签 BeautifulSoup/Python 中获取数据