question
As indicated here: https://www.geeksforgeeks.org/compute-the-correlation-coefficient-value-between-two-vectors-in-r-programming-cor-function/ The cor() function needs two vectors. The only way that works is if you are looking at the correlation between "Month" and "Cort." If you interested in the correlation between Cort measured in month 3 versus month 12 then you are not getting the right answer. Animal ID is not relevant in this analysis (as presented). The animals that have been measured twice would be a repeated measures analysis (by default) unless there is some reason to suspect that the six month lag is too long for an outcome in month 3 to influence the outcome in month 12. The remaining animals are an experimental design for avoiding a repeated measures analysis. This would be something like a t-test to determine if the animals in Month 3 are different than Month 12. Tim From: Carolyn J Miller <cjmill04 at syr.edu> Sent: Tuesday, January 31, 2023 9:30 AM To: PIKAL Petr <petr.pikal at precheza.cz>; r-help at r-project.org; Ebert,Timothy Aaron <tebert at ufl.edu> Subject: Re: question [External Email] Hi Timothy, Here's some example data that might help to demonstrate how the data currently looks. AnimalID Month Cort 1 12 0.00591 1 3 0.00583 2 3 0.005722 3 3 0.005838 4 3 0.005873 4 12 0.0059 5 3 0.005724 6 12 0.005924 7 12 0.005758 8 12 0.005901 9 12 0.005894 10 3 0.005731 11 3 0.005951 So Animal ID represents individual, 3 or 12 for month represents either a March capture event or a December capture event and then the corresponding cort value (which I used a random number generator to create these values above). Petr, I was afraid of that response, that by using cor() I'm fundamentally just testing the correlation for the 3 individuals that have both March and December samples. If you guys have other thoughts I'd appreciate any suggestions. Thanks for your help and clarifying that for me. Carolyn J. Miller M.S. Student, Ecology SUNY-ESF, Environmental Biology
From: PIKAL Petr
Sent: Tuesday, January 31, 2023 2:36 AM
To: Carolyn J Miller; r-help at r-project.org<mailto:r-help at r-project.org>
Subject: RE: question
Sent: Tuesday, January 31, 2023 2:36 AM
To: Carolyn J Miller; r-help at r-project.org<mailto:r-help at r-project.org>
Subject: RE: question
Hallo Carolyn