I'm grateful for advice on which R analysis to choose for the following study:
I measured stress in one subject on 27 days in the night and in the morning.
Now I want to predict stress in the night via stress in the morning. All data stem from the same subject. There are 27 timepoints in total.
How do I account for the repeated measures in this?
A normal lm doesn't work since it's repeated. When i use lme4, R gives a warning: If i cluster within ID (always the same participant) the warning is: I have to have more than 1 observation. If I cluster within video (27 videos) R warns that the number of clusters has to be smaller than the number of observations.
I have thought about uSEM, lme4, gee or dynamic linear regression.
Do you have any ideas how I model this? I always want to predict the stress in the night by the stress the former day.
Any advice is very welcome and thank you so much for reading this far.
head(data)
dailystress nightstress dailystress.l1 Video
1 0.333 0.166 0.183 1
2 1 0.142 0.166 2
3 0 0.0741 0.142 3
4 NA 0.138 0.0741 4
5 1 0.0567 0.138 5
6 0.667 0.102 0.0567 6
str(data) is
dailystress: num [1:26] 0.333 1 0 NA 1
..- attr("format.spss")= chr "F8.2"
..- attr("display_width")= int 14
nightstress: num [1:26] 0.1658 0.1424 0.0741 0.138 0.0567
..- attr("format.spss")= chr "F20.8"
..- attr("display_width")= int 22
dailystress.l1: num [1:26] 0.1834 0.1658 0.1424 0.0741 0.138
..- attr("format.spss")= chr "F20.8"
..- attr("display_width")= int 25
Video: num [1:26] 1 2 3 4 5 6 7 8 9 10
..- attr(*, "format.spss")= chr "F8.0"