Well, it should be difference by ID and TIME for q1:
something like:
for ID 1187
in TIME 1 q1=3
and TIME 2 (for same ID) q1=3
so diff would be 3-3=0
TIME ID q1
1 1187 3
1 1187 3
And I don't know how to make R to find pairs and calculate diff?
2011/2/21 Dennis
On 2011-02-22 12:51, Vlatka Matkovic Puljic wrote:
Well, it should be difference by ID and TIME for q1:
something like:
for ID 1187
in TIME 1 q1=3
and TIME 2 (for same ID) q1=3
so diff would be 3-3=0
TIME ID q1
1 1187 3
1 1187 3
And I don't know how to make
Dear all,
I want to perform paired Wilcoxon signed ranks test on my data.
I have pairs defined by ID and TIME variables.
How can I calculate difference in variables q1, q2 in each pair?
TIME ID q1 q2
1 1187 3 2
1 1706 3 3
1 1741 2 4
2 1187 3 2
2 1706 3 3
2 1741 2 4
Please, any clue!
:)
--
Hi:
Assuming dd is the name of your data frame,
dd$diff - with(dd, q2 - q1)
dd
TIME ID q1 q2 diff
11 1187 3 2 -1
21 1706 3 30
31 1741 2 42
42 1187 3 2 -1
52 1706 3 30
62 1741 2 42
is one way to do it.
HTH,
Dennis
On Mon, Feb 21,
4 matches
Mail list logo