I've got two datasets from the same people and I want to compute a correlation for each person over the two datasets.
Example dataset:
dat1 <- read.table(header=TRUE, text="
ItemX1 ItemX2 ItemX3 ItemX4 ItemX5
5 1 2 1 5
3 1 3 3 4
2 1 3 1 3
4 2 5 5 3
5 1 4 1 2
")
dat2 <- read.table(header=TRUE, text="
ItemY1 ItemY2 ItemY3 ItemY4 ItemY5
4 2 1 1 4
4 3 1 2 5
1 5 3 2 2
5 2 4 4 1
5 1 5 2 1
")
Does anybody know how to compute the correlation rowwise for each person and NOT for the whole two datasets?
Thank you!