我正在尝试了解某些事件如何影响网页的访问者。例如,我有一张表格,其中包含过去两个月内每分钟新有机访客的数量和电视广告的日期时间。例如:
DF:
+------------------+----------+----------+
| datetime | adshown | visitors |
+------------------+----------+----------+
| 2017-06-07 13:00 | 1 | 1 |
| 2017-06-07 13:01 | NA | 3 |
| 2017-06-07 13:02 | 1 | 9 |
| 2017-06-07 13:03 | NA | 4 |
| 2017-06-07 13:04 | NA | 11 |
| 2017-06-07 13:05 | NA | 7 |
+------------------+----------+----------+
由于展示广告的效果不会立即转化为访问者,而是会增加几分钟窗口的访问量,我试图看到与互相关函数的相关性,这可以考虑到帐户延迟
ccf(df$visitors, df$adshown)
然而,使用它似乎给了我一个完全不相关数据的图表:https://i.stack.imgur.com/1w3wM.png
这可能是使用错误方法的结果,还是我们的广告和访问者根本不相关? 这是前20行的输入数据:
structure(list(datetime2 = structure(c(1491166800, 1491166860,
1491166920, 1491166980, 1491167040, 1491167100, 1491167160, 1491167220,
1491167280, 1491167340, 1491167400, 1491167460, 1491167520, 1491167580,
1491167640, 1491167820, 1491167880, 1491168060, 1491168120, 1491168180
), class = c("POSIXct", "POSIXt")), visits = c(2, 2, 1, 1, 1,
3, 1, 0, 2, 2, 2, 3, 1, 3, 1, 2, 1, 3, 2, 0), STATION = c("0",
"WEB MISC", "0", "0", "0", "0", "YOUTOO AM", "ES TV", "0", "0",
"0", "0", "0", "0", "0", "0", "0", "0", "0", "ES CARS"), ad2 = c(0,
2, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2)), .Names =
c("datetime2",
"visits", "STATION", "ad2"), row.names = c(NA, 20L), class = "data.frame")