【问题标题】:path.plot in R synth package not plotting over whole time periodR synth 包中的 path.plot 未在整个时间段内绘制
【发布时间】:2020-05-30 01:38:51
【问题描述】:

我使用了 synth 包来生成用于绘图的 dataprep.out 和 synth.out 对象。但是,当我使用 path.plot 函数时,该图默认为只是治疗后的时期。

path.plot(
  synth.res = synth.out, 
  dataprep.res = dataprep.out,
  Ylab = "black mortality rate (per 100000) among 80-84 yos", 
  Xlab = "year", 
  Legend = c("Iowa", "synthetic Iowa"), 
  Legend.position = "bottomright"
  )

default plot: just post-treatment period

当我调整 Z.plot 参数时,只绘制了预处理期。

path.plot(
  synth.res = synth.out, 
  dataprep.res = dataprep.out,
  Ylab = "black mortality rate (per 100000) among 80-84 yos", 
  Xlab = "year", 
  Legend = c("Iowa", "synthetic Iowa"), 
  Legend.position = "bottomright",
  Z.plot = TRUE
  )

plot specifying Z.plot parameter

如果有人能确定为什么会发生这种情况,我将不胜感激。谢谢!

【问题讨论】:

    标签: r


    【解决方案1】:

    我想通了,但我想我会回答,以防它对其他人有帮助。请务必将 dataprep() 中的 time.plot 项指定为完整时间段,而不仅仅是后处理时间段。

    【讨论】:

      猜你喜欢
      • 2021-04-09
      • 2020-04-07
      • 1970-01-01
      • 2019-10-21
      • 2016-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-04
      相关资源
      最近更新 更多