# Linear Mixed Models for randomized clinical trial

I am working on analyzing data from a randomized clinical trial which is studying the effect of a mesh type on patient-reported pain. The 2 study arms are the 2 different meshes (biologic and synthetic). One study arm received the biologic mesh, and the other received synthetic mesh.

The timepoints measured are before intervention (before receiving mesh) and at 1 months, 6 months, 12 months, and 24 months after receiving mesh. I am trying to analyze the effect of synthetic mesh on pain across different timepoints.

I am using the lmer package in R and so far have built the following model:

model <- lmer(pain ~ treatment group * Timepoint + (1 | patient), data = data)


My question is if this model will give me what I am looking for (the p-value of the effect of the mesh type on overall time trends).

My concerns are

1. Should time be continuous or categorial?
2. Should I handle pre and post timepoints differently?
3. How is the data typically reported in scientific journals (I could not find much information on this)?
• If you decide to treat time as ordinal data (categorical and ordered), then you're assuming the time between jumps are equal. This isn't necessarily true for your data. You could treat time as continuous and have pre-intervention be negative time. Sep 15, 2023 at 19:34
• How is the outcome pain measured? Sep 15, 2023 at 19:48
• Thank you JLinsta. I thought it would be okay to treat them as discrete still in R? Outcome pain is measured numerically Sep 15, 2023 at 20:03
• For (3), rather than looking for a textbook or article on "how are data typically reported in scientific journals", you can just read the scientific journals themselves. However, beware that peer-reviewed papers contain many statistical flaws, so doing it how everyone else does it may not be the best. Sep 15, 2023 at 23:16
• For your outcome, "numerical" is not really enough to describe your pain outcome. Perhaps it's an integer chosen from 0 to 10? Or a visual analog scale (that is, point or mark on a line representing a pain range) often measured 0 to 100? Sep 15, 2023 at 23:19

Should time be continuous or categorial?

As some have already noted, your time variable does not have equal intervals, so it probably wouldn't make sense to use as a continuous variable here. Better to run it here as categorical and you can then use the contrasts against the intercept to understand how the average response changed between set times (which I assume have some theoretical relevance base on the selected times here).

Should i handle pre and post timepoints differently?

I'm not sure in what way you mean by this. I would assume you just leave the time points as-is unless you have some reason to change them. You can clarify what you mean there if that doesn't make sense.

How is the data typically reported in scientific journals (I could not find much information on this)?

I provide a more long-winded answer about how to do that here. I would suggest going through the articles I include with that answer so you don't miss anything, particularly Meteyard & Davies, 2020.

On a final note, because your data is bounded between 0 and 10, you may want to consider which family you model this data with, as the predictions and consequently the residuals may behave strangely. Check the distribution of your response and see if it closely resembles something in one of the distributions listed here. For example, binary data is normally estimated with glmer using the binomial family because running a Gaussian family on it is constrained by the fact that data is limited to values that span $$[0,1]$$. Some examples are given in Harrison et al., 2018. Some contextual information about bounded data in regression can be found here, wherein the answerer recommends logit or probit models for bounded response regressions.

#### References

• Harrison, X. A., Donaldson, L., Correa-Cano, M. E., Evans, J., Fisher, D. N., Goodwin, C. E. D., Robinson, B. S., Hodgson, D. J., & Inger, R. (2018). A brief introduction to mixed effects modelling and multi-model inference in ecology. PeerJ, 6, e4794. https://doi.org/10.7717/peerj.4794
• Meteyard, L., & Davies, R. A. I. (2020). Best practice guidance for linear mixed-effects models in psychological science. Journal of Memory and Language, 112, 104092. https://doi.org/10.1016/j.jml.2020.104092
• I cover longitudinal ordinal semiparametric models here; see also this. Sep 16, 2023 at 11:15
1. Should time be continuous or categorial?

In my opinion, time should be categorical. The response over time may be non-linear and treating time categorical avoids any bias with specifying the functional form. Now, you spend additional degrees of freedom to do this, but that may be something that could have been planned around in the design stage. Next time I suppose.

1. Should I handle pre and post timepoints differently?

The pre-measurement isn't all that interesting to be modelled in my opinion. If treatment was randomized on the patient level, then the pain scores should be equal in expectation. You could model this, but instead I think it would be better to adjust for the pre-pain measurement a la ANCOVA.

If the pre pain level is at all correlated with the post pain level (and it should be) then you will have additional power to detect treatment effects, thanks in part to the lower residual standard error.

1. How is the data typically reported in scientific journals (I could not find much information on this)?

I suppose this depends on your estimand of interest, the venue in which you will publish, your audience, their statistical experience, etc, etc. While I can't say with certainty, it might be good to present differences at each time point and the associated confidence interval