gltCode in 3dLME

The model you specified

-model "pill+visit+order+sex+age+motion" \

implicitly assumes that the effect of age is identical across the two levels of pill, as it excludes any interaction between them. This assumption is inconsistent with your stated goal of assessing whether the age effect differs by pill condition.

To align the model with that objective, the interaction between pill and age should be included, for example:

-model "pill*age+visit+order+sex+motion" \

This specification allows the age effect to vary as a function of pill, making the interpretation of differential age effects well defined.

As a side note, ensure that each covariate included in the model is justified for the specific effects you intend to test. See more discussion here.

Gang Chen