Hello everyone,
I’d like to build a network matrix G, where Gij = ni-1, in which ni is the size of the group of individuals (excluding the individual himself). The information about the size of the group is given by the variable “tamanho”. We consider students belonging to the same group only those who are in the same class. The classes are identified by a code given by the variable “turma”. Moreover, we have 5 distincts periods, identified by the variable “onda”. Thus, I want to build a matrix G for each one of the periods. The individuals are identified by the variable “idaluno”. The shape of the database is the following:
(id student) (id class) (period) (class size)
idaluno turma onda tamanho
1 100 1 2
1 101 2 2
1 700 3 3
1 900 4 1
1 540 5 1
2 100 1 2
2 101 2 2
2 700 3 4
2 870 4 3
2 450 5 3
3 200 1 2
3 201 2 2
3 700 3 4
3 870 4 3
3 450 5 3
4 200 1 2
4 201 2 2
4 700 3 4
4 870 4 3
4 450 5 3
Thank you for any help!
I’d like to build a network matrix G, where Gij = ni-1, in which ni is the size of the group of individuals (excluding the individual himself). The information about the size of the group is given by the variable “tamanho”. We consider students belonging to the same group only those who are in the same class. The classes are identified by a code given by the variable “turma”. Moreover, we have 5 distincts periods, identified by the variable “onda”. Thus, I want to build a matrix G for each one of the periods. The individuals are identified by the variable “idaluno”. The shape of the database is the following:
(id student) (id class) (period) (class size)
idaluno turma onda tamanho
1 100 1 2
1 101 2 2
1 700 3 3
1 900 4 1
1 540 5 1
2 100 1 2
2 101 2 2
2 700 3 4
2 870 4 3
2 450 5 3
3 200 1 2
3 201 2 2
3 700 3 4
3 870 4 3
3 450 5 3
4 200 1 2
4 201 2 2
4 700 3 4
4 870 4 3
4 450 5 3
Thank you for any help!
Comment