# Model design with repeated equivalent measurements

I have a population of n individuals.

For each of them, I have measured an outcome once: $$Outcome_{ i} \,\,\,\ i=1..n$$

I have also some measurements: for each subject I have a variable number of measurements $$m_i$$ , which are acquired over time but they can be considered completely interchangeable or equivalent for our study (e.g. as they were acquired in the same moment).

$$Meas_{i,j} \,\,\,\ i=1 .. n \,\,\,\ j=1 .. m_i$$

I would like to test if there is association between $$Outcome$$ and $$Meas$$. I have around n=20 and m<=40.

• If I aggregate the data e.g. average $$Meas$$ over $$j$$, I am under-powered for my effect size.
• If I just pool the individual measurements treating them as independent, I clearly violate model assumptions.

I am considering to use linear mixed models adding subject as random effect.

• Most example I see would also model a subject-specific slope for the measurements. This works well for longitudinal data where repeated measurements are over time, one can conclude that there is a population-trend combined with individual trends over time, with regression coefficient measuring the strength of the individual trends.

• However, in my case measurements are not longitudinal so I have tried to model individual-specific intercept.

In python/statsmodels:

 model= smf.mixedlm("OUTCOME~1+MEAS",data=df,groups=df.loc[:,'IndividualID'],re_formula="~1")


In this case, my model collapses to:

--------------------------------------------------------------
Coef.   Std.Err.   z    P>|z| [0.025 0.975]
--------------------------------------------------------------
Intercept          21.050     0.259 81.407 0.000 20.543 21.557
Meas               -0.000     0.000 -0.000 1.000 -0.000  0.000
Group Var           1.337 13217.344
==============================================================


Basically, my model is giving just a constant value per individual.

What can I conclude from this? Can I just blame sample size being too small?

How can I check if mixed GLM is more appropriate then mixed LM in this context?Residuals are basically measurement values minus their individual-specific average.

• If the measures of $Meas$ are all estimates of the same underlying individual parameter, then even if you knew exactly what that parameter was (eg, you have infinitely many measures of $Meas$ per individual, you'd then only have 20 data points to estimate the relationship between it and the outcome. If that's not enough precision for effect sizes you care about, I think you are out of luck. If the measures of $Meas$ carry some extra information related to the outcome in some way, you might have more than 20 data points. What is causing the variation in individual measures of $Meas$? – CloseToC Oct 15 '19 at 11:30
• the variation in the individual measurement might (nonlinearly) be associated with the outcome as well (at least is the expectation). the variation might be also caused by some intrinsic characteristic of the individual – ErroriSalvo Oct 15 '19 at 16:09
• I think your only realistic way to improve upon the model in which you average the measures and use that as a predictor is to think about how that variation might be related to the outcome. I'd make a plot similar to this (seaborn.pydata.org/examples/horizontal_boxplot.html) for each of the 20 individuals, on the y axis, sorted by their value of outcome. That should give you an idea whether variation in those measures is associated with the outcome. I don't think mixed models with random coefficients are of any use if you only have a single outcome observation per individual. – CloseToC Oct 15 '19 at 21:03
• It's still unclear what you are really trying to do. Maybe it's a bit short but it seems that you have a vector of length $n$, and $m_i$ data points for each entry $i$. Now you try to find some magic thing to correlate/regress/approximate the corresponding number $n_i$? The magic is of course a model, but this doesn't just appear. – cherub Oct 17 '19 at 15:12