# Repeated measures mixed model in r

I want to compare how fast children from 2 countries [Country] run on a treadmill [Speed] at two time points [Time]. Specifically, I wanto to see whether the change over time is different in those two countries. Moreover, I want to control for the fixed effects of age at baseline [Ageb], weight at baseline [Weightb], and height at baseline [Heightb]. I wanto to allow children of different ages to have different slopes (older children should gain more speed compared to younger children). Finally, I want to control for the random effects of examination date [Date] and treadmill used to measure the speed [TreadmilId]. Date and Treadmill are time-varying.

I thought a repeated measures mixed effects model would be appropriate for this research question. What should be the notation in lme4 then?

Would the below notation be good?

Speed ~ Time*Country + Ageb + Heightb + Weightb + (1+Ageb|SubjectId) + (1|Date) + (1|TreadmillId)

Alternatively, if I treated Age, Weight, and Height as time varying covariates, could I use the following notation:

Speed ~ Time*Country + Age + Height + Weight + (1+Ageb|SubjectId) + (1|Date) + (1|TreadmillId)

I would be greatfull for alternate approaches to the problem as well.

For the second point, exhaustive model testing is required for best formulas, and the first thing that comes to mind is infrequently the best. From the example, compare the Bland-Altman plots below for the theory that glomerular filtration rate is scaled by body surface area (Haycock formula; a power function of Weight and Height) versus a power function of extracellular fluid volume and weight. Note the reduction of both $$y$$-axis variability and trending over the $$x$$-axis range using the better, $$f(V,W)$$, formula. Finally, to identify which formula is best, a lot of testing should be performed for an exhaustive list of variable combinations using multiple tests, like Bland-Altman and others (ANOVA F-test and partial probabilities, multicollinearity, adjusted R$$^2$$, $$p$$-testing of residual distributions type using multiple tests then one can hopefully use AICc, BIC and other ML tests, and so forth.) It takes a lot of work to get good answers, but without doing the work, the results may never be used by other authors, worse if they are actually used by others and are misleading.