一个示例/测试数据看起来像下面这样。“dyad”是一组2个人在讨论“post”中互相交谈(1行= 1条消息)。这些观察结果是按时间顺序排列的。
structure(list(post = c(1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3),
dyad = c("111_222", "111_222", "111_222", "222_345", "333_567",
"333_899", "333_990", "435_123", "435_555", "435_123", "435_111",
"435_555")), class = "data.frame", row.names = c(NA, -12L
), codepage = 65001L)
我尝试创建的是两个变量:“响应1“和“响应2”。
*回答1:(a)不同于焦点二单元组(行)的不同二单元组的数目,其中(b)在一个post内的焦点二单元组(c)**之前。
- response 2:这只是帖子中焦点对的顺序。
结果可能如下所示:
+------+---------+-----------+-----------+
| post | dyad | response1 | response2 |
+------+---------+-----------+-----------+
| 1 | 111_222 | 0 | 1 |
+------+---------+-----------+-----------+
| 1 | 111_222 | 0 | 2 |
+------+---------+-----------+-----------+
| 1 | 111_222 | 0 | 3 |
+------+---------+-----------+-----------+
| 1 | 222_345 | 1 | 4 |
+------+---------+-----------+-----------+
| 2 | 333_567 | 0 | 1 |
+------+---------+-----------+-----------+
| 2 | 333_899 | 1 | 2 |
+------+---------+-----------+-----------+
| 2 | 333_990 | 2 | 3 |
+------+---------+-----------+-----------+
| 3 | 435_123 | 0 | 1 |
+------+---------+-----------+-----------+
| 3 | 435_555 | 1 | 2 |
+------+---------+-----------+-----------+
| 3 | 435_123 | 1 | 3 |
+------+---------+-----------+-----------+
| 3 | 435_111 | 2 | 4 |
+------+---------+-----------+-----------+
| 3 | 435_555 | 2 | 5 |
+------+---------+-----------+-----------+
1条答案
按热度按时间8i9zcol21#
我们可以用