I have the following data:
ID       Value
1         3
1         5
How can I compute the mean by ID, and put the mean in the data frame as a new variable such that it is repeated for the same ID. The result should look like this:
ID       Value   Mean
1         3       4
1         5       4
Thanks.