我有两个二值化事件(eventA 和 eventB),我想知道这两个事件是否有任何巧合。所以我将使用新的包 CoinCalc 来研究这两者之间的潜在关系。
library(CoinCalc) #note that the package is not visible (at least for) me in CRAN. I got it from GitHub https://github.com/JonatanSiegmund/CoinCalc
两个二元事件
eventA= c(0,1,0,0,1,1,0,0,1,1,0,0,1,0,1,0,1,0,1,1,1,1,0,0,0,1,1,1,0,0,1,1,0,1,1,0,1,0,0,0,1,1,0,0,0,1,1,0,1,1,1,1,1,1,0,1,0,0,0,1,1,0,0,0,0,0,1,1,0,0,1,1,1,0,0,1,0,1,1,1,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1)
eventB = c(0,1,0,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,1,1,1,1,1,0,1,1,1,0,0,1,0,1,1,1,1,1,1,0,0,1,1,1,0,1,1,1,1,0,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,0,1,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,1,0,0,1,0,1,0,1,1,0,0,0)
运行 ECA 分析
ca.out <- CC.eca.ts(eventA, eventB,delT=2,tau=2)
这产生:
$NH precursor
1对
$NH trigger
1错误
$p-value precursor
1 0.2544052
$p-value trigger
1 0.003287963
$precursor coincidence rate
1 0.8243243
$trigger coincidence rate
1 0.9285714
我想确保我正确理解了这一点。根据结果,只能拒绝触发器的零假设,在0.003水平上具有统计学意义,符合率是0.92(非常高,这相当于R2吗?)。这是否可以解释为 eventB 对 eventA 的影响很大,而不是相反?
然后我可以使用 CC.plot 函数绘制这两个事件:
CC.plot(eventA,eventB,dates=c(1900:2040),delT=2, tau=2, seriesAname = 'EventA', seriesBname = 'EventB')
有什么方法可以修改 CC.plot 中的图形参数吗?虚拟年份在该图中不可见。我想更改字体、大小、颜色等。有没有办法通过调用模型输出(ca.out)来绘制相同的图形?
提前致谢!