# Repeated measures and repeated predictors

Assume that I have a set of subjects undergoing a treatment. Every day in the morning each subject takes a (variable) dose of medication. Every day in the evening we measure the parameter of interest.

The treatment lasts 4 days, i.e. for each subject we have 4 doses injected (one each morning) and 4 measurement of the variable of interest (measured each night)

It is a repeated measures problem, with the particularity of having the predictor changing every day (the dose injected is not the same every day).

Which test should I use to determine whether the treatment (dose injected in the morning) affect the output (variable measured at night)?

It's still a repeated measures model because you have more than one level of error. This is what you have:

• person: random effect
• measurement error: random effect
• measurement type: fixed effect categorical, 4 levels
• treatment type: fixed effect categorical, 4 levels

treatment type and measurement type are crossed. All 16 possibilities exist. Measurement and the measurement x treatment interaction terms are tested against within person error. Treatment type is compared to the between person error.

This would probably work with repeated measures assuming everything is balanced and you have no missing data. Alternatively, you could fit the model as a mixed model (SPSS Mixed, or lme() in R). You would want to set up the data in long form, so that each row of the database corresponds to one measurement. You would then have an indicator variable for the Person and for the treatment type.

I hope you randomized treatment type across days.

• Thanks for your answer. I do not have a balanced dataset and I do have missing data. I would like to use a mixed model, but all the time I've used it I had several measurements for the same subject and fixed effects like age, gender, bmi. I did not understand how I can I include different injections of the treatment. PS mine is a theoretical example. – gabboshow Sep 7 '15 at 18:35
• PPS I use MATLAB – gabboshow Sep 7 '15 at 18:49
• @Placida: Doesn't the randomness from the measurement errors just add to the residuals otherwise? Also, is missing data really a big problem? The other days (rows) from the same patient can still be used even though one or two of the days (rows) are excluded due to missing data. – JonB Sep 7 '15 at 18:52
• @gabboshow: I think Placida is right to include dose as a categorical variable as long has you have just a few different doses. – JonB Sep 7 '15 at 18:54
• @JonasBerge missing data makes the design unbalanced, so the classic "repeated measures anova" does not work. The F-tests do not test the hypotheses of interest. However a mixed model approach does not require those assumptions. The parameters are estimated from the data you have. Mixed models use maximum likelihood estimation and repeated measures is basically a method-of-moments approach. RM is good when the sample is small but balanced. Otherwise, not so much. – Placidia Sep 7 '15 at 19:02