首页 > 解决方案 > 在 R 中绘制 pSeries 对象

问题描述

我目前正在尝试使用以下代码在 R 中绘制池化 ols 回归的残差:

plot(
  SS_LinReg_LATAM_Original$residuals,
  plot = c("lattice", "superposed"),
  scale = TRUE,
  transparency = TRUE,
  col = "black",
  xlab = "Date",
  xaxt = "n",
  ylab = "Residual in Percentage Points",
  ylim = c(-7,7)
) 

其中 SS_LinReg_LATAM_Original 是使用 plm() 和相应 pdata.frame 的合并 OLS 回归,索引 = c("Country", "Month")

这给了我下图:

残差图

我现在有三个问题,到目前为止我无法在网上找到答案:

  1. 如何在国家名称后面获得白色背景?
  2. 如何摆脱图表中的黑条?
  3. 如何以 5 年的间隔为每个面板设置 x 轴?

非常感谢您的帮助!

标签: rplotgraphicsplmpseries

解决方案


推荐阅读