I have a dataset of 2 variables collected repeatedly at 5 different timepoints on a group of individuals, structured like this:
ID TimePoint Variable Result
1 1 Var1 5
2 1 Var1 7
3 1 Var1 3
1 1 Var2 5
2 1 Var2 7
3 1 Var2 3
1 2 Var1 0
2 2 Var1 4
3 2 Var1 5
1 2 Var2 6
2 2 Var2 9
3 2 Var2 3
.
.
.
n
I want to investigate whether there is a linear relationship between the variables across the timepoints.
Separately I have carried out repeated measures testing to determine how the individual variables change for the group over time and a generalized linear model at each timepoint to investigate the relationship between the 2 variables. I am having trouble finding a method to investigate that relationship across all 5 of the timepoints. Can anyone recommend a method to achieve that?
N.B; the data in the table is just an example, in the real dataset the participant n = 28.