r - Correlation of subsets in a data frame -


I am trying to calculate the relationship of two variables of a data frame subset and here are the data samples: < / P>

  participants & lt; -c ("A01", "A01", "A01", "A01", "A01", "A01", "A02", "A02", "A02", "A02", A02 "," A2 2 " ) Technical qualification & lt; -c (4.20, 2.25, 2.75, 1.67, 1.50, 4.11, 2.50, 2.00, 2.50, 2.40, 3.25, 3.10) Grandmany & lt; -c (2.7375, 2.7375, 2.3300, 2.3300, 2.9900, 2.9900, 2.7375, 2.7375, 2.3300, 2.3300, 2.9900, 2.99, 00) Master = Data. Frame (Participant, Technical Quality, Grandman)  

The relationship between grandma and technical competence The calculation requires that each participant, in the sample, they are A01 and A02, and for further processing, the correlation result in a new data frame. Just want to hedge.

Just wondering what is a good way to do this in R? Because I have 30 participants and my original data has about 600 lines?

Thanks for any advice!

You can use by : Master ([-1], Master [[1]], FUN = function (x) cor (x [1], x [2])) # Master [[1] ]]: A01 # [1] 0.2662404 # ------------------------ ---------------- --------------------- Master # [1]]: A02 # [1] 0.6048852


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -