lmer for repeated measures I have several animal pairs pair. For each, I repeatedly measured daily proportions of time they spent in contact time.con (30-60 measurements for each group, 1 measurement per date). I want to compare how much time different pairs spent in contact using lmer and controlling for repeated measures. The pairs are permanent, so essentially pair = individual. Here is a simplified example:
      pair   date     time.con

 [1,] "1"  "01.06.17" "0.12"  
 [2,] "1"  "02.06.17" "0"     
 [3,] "1"  "03.06.17" "0.11"  
 [4,] "2"  "04.06.17" "0.34"  
 [5,] "2"  "05.06.17" "0.02"  
 [6,] "2"  "06.06.17" "0.07"  
 [7,] "3"  "01.06.17" "0.14"  
 [8,] "3"  "02.06.17" "0.26"  
 [9,] "3"  "03.06.17" "0.1"

So, the fixed effect would be pair. The question is, how do I control for repeated measures? If I use pair as both fixed and random effect, the model, obviously, fails to converge:
`lmer(time.con ~ pair + (1|pair))`

I guess that's where I'm meant to use date somehow (as nested in pair?), but I cannot get the syntax right:
`lmer(time.con ~ pair + (1+pair|date))` (doesn't work)

I'm probably missing something simple, as I'm new both to R and lmm. Would appreciate any advice!      
 A: This seems to be a longitudinal study, with measurements over time for each pair. As a first step, based on the date variable you could construct the follow-up time variable, which is the time from the first measurement. Think however carefully if the first measurement really is the time 0 for each pair for your experiment or perhaps another date.
Then, you include random effects for the pair grouping variable, but not include it also as a fixed effect. You could start with a random intercepts model, e.g.,
fm1 <- lmer(time.con ~ follow_up_time + (1 | pair), 
            data = your_data)

This model postulates that the correlations over time within a pair remain constant. You could extend the model by assume that the correlations decrease with the time span between measurements using a random intercepts and random slopes model, e.g.,
fm2 <- lmer(time.con ~ follow_up_time + (follow_up_time | pair), 
            data = your_data)

To evaluate if you need the random slopes, you could do a likelihood ratio test, i.e.,
anova(fm1, fm2)

A: (my first attempted answer on stackexchange...fingers crossed that this works)
I'm not an expert, but I'll offer some feeback.  I don't have enough reputation to put this in a comment, so here's an answer.
I guess the first question to ask is, what do you wish to learn from the data?  You say you want to compare them.  By that, do you just want to see the means for each pair?  If so, you could look at either the unadjusted means or shrunk means:


*

*The unadjusted means by using lm().  That is, without pooling you could use:


lm(time.con ~ Pair)
To get the coefficients:
coef( lm(time.con ~ Pair) )


*The shrunk means by using lmer().  That is, with pooling you could use:


lmer(time.con ~ (1|Pair))
To get the coefficients:
coef( lmer(time.con ~ (1|Pair)) )
If that's not what you have in mind when you say you want to compare them, then what does "compare" mean to you in this context?
Finally, since your response variable has a hard lower boundary at 0, and some values that are close to it including one right at 0, then the typical assumption of the error term being Gaussian might not be the best.  If you want to account for this by using generalized learn models, glm() and glmer() might be helpful.  Hopefully someone else can add more details on whether or not it'd be worth it to go to a generalized linear model.
For more background, I think this is a good resource freely available on the web:
https://bookdown.org/roback/bookdown-bysh/ch-MLRreview.html
I worked through an old version, but it looks like they updated it a few days ago.
