Choosing a linear model to take into account multiple observations from the same individuals I’m looking at how temperature varies across age. Can you help me to choose the most appropriate linear model to this analysis?
I’ve got multiple measures from 1 individual per age (13 in total), and in two cases only (11yo and 15yo) I've got 2 pieces of data from 2 individuals. This's an example of how my dataset looks like:
  temperature  id   age  
1      20       A     15
2      22       A     15 
3      21       D     15
4      20       B     10
5      19       B     10
6      19       C     9

I could calculate the mean and use a univariate test but what if I want to take into account the multiple observations per individual?
 A: I would do it in two steps. First a oneway anova to check whether there are any significant differences between the individuals at all:
fit <- lm(temperate ~ id)
anova(fit)

If the anova is not significant then the differences between individuals are no larger than measurement to measurement variation on the same individual, so there is no point in proceeding further.
If the anova is significant, then compute average temperature per individual and perform a linear regression to explore whether the between-individual differences can be explained by age.
A: A mixed model is not indicated here, because you have only 3 individuals, so we would be asking the software to estimate a variance for a normally distributed variable (since random effects are assumed to be normally distributed) from only 3 observations of it.
A more appropriate model would be:
temperature ~ age + id

This will take account of the multiple measures within id
Edit: Gordon is right - see comment below - this approach will not work. id and age are collinear so you can't put them in the same model and instead you will need to take the average temperature for each id
