I have a dataset (con) divided in 2 groups (A and B) and for each sample from group A (1-5), group B has a correspondent sample (1-5), each sample has different measures (zinc, iron, cadmium) pertaining to it.
My intended goal is making a correlation test between A1-B1;A2-B2;A3-B3,...measures.
My question is, is there a way to make such a individual correlation and then trace a linear model graph or if I can just separate the groups and do a cor.test()
between the two subsets?
I have created two different subsets (conA, conB), using:
cor.test(conA$Zinc,conB$Zinc, method="spearman",exact=FALSE)
to get the overall correlation for each measure but I wanted to make each pair wise correlation which I don't think it's been done this way.