首页 > 解决方案 > 如何在一张图中可视化来自不同模型的系数?

问题描述

我有 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")

标签: r

解决方案


推荐阅读