5

Suppose I have a 6 week weight-loss program, that I know is only effective in a fraction of the population. I weight the participants at baseline, after 1 week and after the full 6 weeks.

$$ T_0 = Baseline $$ $$ T_1 = 1\ Week $$ $$ T_2 = 6\ Weeks $$

I want to investigate if the effect at after 1 week can indicate if it is worthwhile to continue the program.

A naive approach would be to see if $$ WLoss_{T1} = \frac{W_{T0} - W_{T1}}{W_{T0}} $$ is correlated with $$ WLoss_{T2} = \frac{W_{T1} - W_{T2}}{W_{T1}}$$

and maybe decide some minimal meaningful weight loss (eg $WLoss_{T2} > 2 \%$) and use a receiver operating characteristic (ROC) analysis to see how well $WLoss_{T1}$ can predict this weight loss.

This would, however, underestimate the correlation between $WLoss_{T1}$ and $WLoss_{T2}$ due to the mathematical coupling between $WLoss_{T1}$ and $WLoss_{T2}$ (both use $W_{T1}$). A persons weight loss after 1 week could simply be due to measurement error and random variation in body weight (random error), and the next measurement would likely be closer to baseline, due to the same random variation in body weight measurement, giving a negative correlation between $WLoss_{T1}$ and $WLoss_{T2}$.

The problem can also be viewed as regression towards the mean.

What are appropriate ways of avoiding the bias caused by this mathematical coupling?

JohannesNE
  • 250
  • 1
  • 9
  • I don't like weight. Yes, its "weight loss". I feel that is focus on the negative. It should be "health gain", but that isn't a meaningful idea in our civilization. If it were me, I would not work in terms of raw weight, or relative weight, but go in the direction of mean relative change of BMI per week. This means that 6 weeks are scaled to one week, and week-to-week differences are considered. I might also group by gender, ethnicity, and age-bucket, because those have big impacts on ease of weight loss. It depends on sample-count. Good luck. Do you have "toy" data for an answer? – EngrStudent May 01 '20 at 20:09
  • Why don't you use $W_{T0}$ as the baseline in both losses? And, once you do, why can't you simply perform linear regression on the points $(WLoss_{T1}, WLoss_{T2})$? You might argue that $WLoss_{T2}$ is maybe not linearly related to $WLoss_{T2}$. You could counter that with polynomial terms in the regression, but you should preferably have a physical justification for the choice of your polynomial, or whatever non-linearities you choose to include. – Igor F. May 04 '20 at 12:58
  • @EngrStudent, 'suppose' is to be taken literally. My actual measure and intervention is more complex (and not related to weight), but weight loss is a perfect analog. This statistical problem is common in medical research (e.g. how early can we predict the effect of treatment with antidepressants?), but I have not yet seen a good solution to it. – JohannesNE May 05 '20 at 07:33
  • @IgorF. This would overestimate the correlation, since $WLoss_{T1}$ and $WLoss_{T2}$ are mathematically coupled by $W_{T0}$. Any random variation at T0 will contribute to the correlation between $WLoss_{T1}$ and $WLoss_{T2}$. – JohannesNE May 05 '20 at 07:37

4 Answers4

1

Followig comments below rolando2 post, I was about to suggest you to make the regression: $$Weight_{i,t} = c_i + \alpha . 1(T_1) + \gamma . 1(T_2) + \epsilon_{i,t}$$ Then you would get a matrix of variance-covariace of the coefficients. Maybe it would be enough to look at $cov(\alpha,\beta)$ (and to check somehow that it is significantly positive). But, if I make no mistake, you would have in fact the same problem as described in the question.

Otherwise, if you have a lot of observations, you might divide you sample into cells c (with lots of people; for instance by age-gender). Make on each cell the following regression: $$log(Weight_{i \in c,t}) = c_i + \alpha_c . 1(T_1) + \gamma_c . 1(T_2) + \epsilon_{i,t}$$ In each cell c, there is no reason why the mean effect of $T_1$ and the mean effect of $T_2$ would be subject to individual measurement error.

Then you regress: $\gamma_c = \delta . \gamma_c + \zeta_{i,t}$.

You are interested in $\delta$. Please note that significancy of $\delta$ will be underestimated...because the dependent variable is itself estimated (and the explanatory variable). I would say this does not require to be dealt with if you have enough people in each cell so that the first steps estimations are precise enough. If you do not have many people, there are formula to de-bias the variance when the dependent variable is estimated - but this might be more difficult here as both the dependent variable and the explanatory variable are estimated.

Alexandre C-L
  • 739
  • 5
  • 16
  • If i understand the notation in your first equation correctly, the model has a random intercept per individual, and a fixed, categorical effect of time, corresponding to the R code: `lmer(Weight ~ time + (1|id)`. I think this solves the regression to the mean/mathematical coupling problem, but I'm insure if the model represents the data correctly. I expect individuals to truly have different effects of the intervention, whereas the model fits a an average effect. E.g. some people may truly benefit even if the average weight loss is 0. I want to identify these people early. – JohannesNE May 05 '20 at 07:20
  • I saw the Intercept as being a fixed intercept for the individual. What is suggested allows for heterogeneous effects across cells (for instance by age-gender ; or age-gender-all other observable characteristics you think may be related to heterogeneity of the effect) ; and then it relates later loss from the program to early loss from the program across cells. Here, I do not think heterogeneity of the treatment matters. – Alexandre C-L May 05 '20 at 09:48
  • So even if there is some heterogeneity of the treatment not captured by the observables, the relationship you would have assessed thanks to the heterogeneity of the treatment linked to the observables can still be useful for your purpose. This will however NOT help you identify if the weight variation of an individual after one week was only noise or a true effect. – Alexandre C-L May 05 '20 at 09:52
1

You seem to be talking about an intervention working. If it is only worth persisting with the intervention, if the intervention works, then how do we tell whether it works? This leads to the counter-factual of "What would have happened, had the person not received the intvention?" Otherwise, you might just attribute random fluctuation and regression to the mean to the intervention

To tell what would have happened, if a person had not taken an intervention, you would need a pretty reliable prediction model for what happens without intervention including the uncertainty around that. E.g. such a model might give you the (correlated) prediction for your two time points and you can check whether the change is larger than what you expect for most patients without intervention.

Difficulities include that you would need a pretty large dataset representative of the relevant target population to build a good model (alternatively, you could replace a model with elicited expert opinions about trajectories without intervention, but that is also not very easy). Additionally, it may be that for an individual it might often be quite hard to tell the difference between chance variation and a large causal effect (depends, also depends a lot on the time scale and the size of the intervention effect).

Björn
  • 21,227
  • 2
  • 26
  • 65
  • So lets say nothing happens without the intervention (except random variation). I am still insure if I can ultimately answer the question: How well does the weight loss at week 1 predict whether a person will end up losing at least, say, 2 kg? (A ROC analysis). I know this is slightly simplistic, since it dichotomizes the outcome, but it is a very common way of reporting this type of prediction. – JohannesNE May 06 '20 at 06:43
  • Predicting week 6 weight loss from week 2 weight loss would certainly be a reasonably normal prediction problem and you could try to describe not just a point prediction, but also the uncertainty around it. That would say very little about causal effects or whether it is truly "working" for a person, but may be fine for many purposes. E.g. a function like "People like you with a week 2 weight loss like yours (xx% or y.y kg or whatever) have typiscally lost zz% weight (95% prediction interval weight gain of ww% to weight loss of vv%) by week 6." sounds pretty reasonable to me. – Björn May 06 '20 at 18:52
0

I have the feeling you are over-complicating things: differences...correlation...ROC. You have longitudinal data collected at 3 time points; you could take advantage of this to create a single model, a random-effects model (mixed model; longitudinal model). I think it would take into account everything you have mentioned and would do so in, as John Willett likes to say, one swell foop.

rolando2
  • 11,645
  • 1
  • 39
  • 60
  • The only random-effects model I can think of would be: $Weight = \beta_0 + \beta_1Time + randomeffect_{individual} + \epsilon$. But this assumes a linear effect of time, and it assumes an equal effect for all individual. Both of which are undesirrable for my problem. Thus, i am not sure how a random effects model will help me. – JohannesNE Apr 27 '20 at 15:08
  • "it assumes an equal effect for all individual" - I think the opposite. "linear effect of time" - you might treat time as a categorical variable. – rolando2 Apr 27 '20 at 15:15
  • I see, but if I allow individual 'slopes', I will end op with as many random effects as I have observations. – JohannesNE Apr 28 '20 at 06:47
0

If I understand you correctly, you want to know whether you can reliably classify your participants based on their early weight loss. So it's basically a question of classification. I recon you also have a training data set, with measurements $W0$, $W1$, and $W2$. Let's assume your data look like this:

Weight loss, without labeling

or, relative to the baseline:

Relative weight loss, without labeling

You could, as you suggested, declare some arbitrary boundary (0.02) for the effective weight loss and label your data accordingly:

Relative weight loss, manually labeled

The simplest thing to do now, if you just want to know whether the early weight loss is indicative for the later weight loss, would be to run a t-test on the x-axis (the early weight loss) of the two groups. In Python:

import numpy as np
import matplotlib.pyplot as plt

mu0     =  90
sigma0  =  15
sigma1  =    .2
sigma2  =   1
Na      =  20
Nb      = 200
effect1 =    .99
effect2 =    .975

rng = np.random.RandomState(42)
w0 = rng.normal(mu0, sigma0, Na+Nb)
w1 = np.concatenate([
  (effect1 * w0)[:Na ] + rng.normal(0, sigma1, Na),
  (          w0)[ Na:] + rng.normal(0, sigma1, Nb)
])
w2 = np.concatenate([
  (effect2 * w0)[:Na ] + rng.normal(0, sigma2, Na),
  (          w0)[ Na:] + rng.normal(0, sigma2, Nb)
])

r1 = (w0-w1)/w0
r2 = (w0-w2)/w0

# t-test on the x-axis
from scipy import stats
tt = stats.ttest_ind(r1[r2<.02], r1[r2>.02])
print(tt)

produces:

Ttest_indResult(statistic=-11.912202742445448, pvalue=1.581946945815335e-25)

But you probably want to have a classification algorithm, so you'll need to train a model. A logistic regression will give you not only the probabilities of class membership, but also the p-values for the coefficients, thus answering your initial question:

# logistic regression
import statsmodels.api as sm
logit_model=sm.Logit(r2>.02, sm.add_constant(r1))
result=logit_model.fit()
print(result.summary())

gives you:

                           Logit Regression Results                           
==============================================================================
Dep. Variable:                      y   No. Observations:                  220
Model:                          Logit   Df Residuals:                      218
Method:                           MLE   Df Model:                            1
Date:                Tue, 05 May 2020   Pseudo R-squ.:                  0.4436
Time:                        21:25:18   Log-Likelihood:                -42.182
converged:                       True   LL-Null:                       -75.814
Covariance Type:            nonrobust   LLR p-value:                 2.373e-16
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -3.4028      0.405     -8.393      0.000      -4.197      -2.608
x1           472.5083     77.561      6.092      0.000     320.491     624.526
==============================================================================

If you want to make it less arbitrary and more sophisticated, you can, instead of arbitrary labeling, use clustering (e.g. K-means) on the two-dimensional data and use cluster labels for training your classifier:

from sklearn.cluster import KMeans
# important: need to scale the axes appropriately!
X_SCALE = (np.max(r2) - np.min(r2)) / (np.max(r1) - np.min(r1))
w = np.concatenate([X_SCALE*r1.reshape([-1, 1]), r2.reshape([-1, 1])], axis=1)
k2 = KMeans(n_clusters=2).fit(w)
fig, ax = plt.subplots()
ax.plot(r1[k2.labels_==0], r2[k2.labels_==0], '.', c='orangered')
ax.plot(r1[k2.labels_==1], r2[k2.labels_==1], '.', c='green')
ax.set(xlabel='(W0 - W1) / W0', ylabel='(W0 - W2) / W0', title='Relative Weight Loss, Clustered')
ax.grid()
ax.legend(["Not working", "Working"])
plt.show()

Weight loss - K-means

Logistic regression on data labeled this way is slightly different:

                           Logit Regression Results                           
==============================================================================
Dep. Variable:                      y   No. Observations:                  220
Model:                          Logit   Df Residuals:                      218
Method:                           MLE   Df Model:                            1
Date:                Tue, 05 May 2020   Pseudo R-squ.:                  0.8536
Time:                        21:30:47   Log-Likelihood:                -10.787
converged:                       True   LL-Null:                       -73.691
Covariance Type:            nonrobust   LLR p-value:                 3.389e-29
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const         -7.7915      2.166     -3.597      0.000     -12.037      -3.546
x1          1732.4376    614.892      2.817      0.005     527.271    2937.604
==============================================================================

The following graph shows the logistic regression for arbitrary (manual cutoff) labeling and for K-means labeling:

Logistic regression for treatment effect

Update:

Spurious correlation ("mathematical coupling") is not an issue here. Observe a set where the long-term weight loss is not related to the early weight loss:

rng = np.random.RandomState(42)
w0 = rng.normal(mu0, sigma0, Na+Nb)
w1 = np.concatenate([
  (effect1 * w0)[:Na ] + rng.normal(0, sigma1, Na),
  (          w0)[ Na:] + rng.normal(0, sigma1, Nb)
])
w2 = w0 + rng.normal(0, 2*sigma1, Na+Nb)

Weight loss - no effect

Relative weight loss - no effect

You can define a "meaningful" weight loss to be as low as 0.5%, but it will be equally distributed over the two groups, with and without early weight loss:

Arbitrary cutoff for meaningful weight loss, no effect

The mean relative early weight losses won't differ between the groups:

stats.ttest_ind(r1[r2<.005], r1[r2>.005])
Ttest_indResult(statistic=-0.17757452954060468, pvalue=0.8592220151288611)

and you'll get the same p-value in logistic regression.

If you do K-means, it will find two clusters, but along the x-axis (early weight loss). You need to check that the long-term losses differ in the two clusters.

Igor F.
  • 6,004
  • 1
  • 16
  • 41
  • Unfortunately, this does not address the problem with mathematical coupling between the variables. Since both variables are derived in part from W0, they will be correlated artificially. Any random variation in W0 will affect both variables equally, and hence give a non-physiological correlation between the variables. – JohannesNE May 06 '20 at 06:03