Putting quantified self to the test in IBS

Since roughly last November, I have had IBS-like symptoms but never met Rome 3 criteria until January in terms of percentage of abnormal stools (just hit 25%). I suffer mostly from stomach pain which I attribute to my colon. I am under the supervision of a GI doc and PCP and have had several tests done – everything normal. Right now, we are in the stage of trying different medications and seeing what works.

I’ve been keeping a spreadsheet of each med I take, how much cardio I do, and an AM/PM health quality index (HQI) which i define as follows…

HQI scores from 1 to 4 based on levels of my functionality vs symptoms;
Level 4, no symptoms present and I do everything I wanted to do during the time period (AM or PM)
Level 3, symptoms but able to cope in such a way that I do everything I wanted to do during the time period
Level 2, symptoms but unable to cope in such a way that I don’t get to do everything I set out to do
Level 1, require medical attention due to symptom severity so that I can do anything. (i never hit this level)

I group every BM by bristol stool scale using an android app. For each day, I create another data product from this called adverse event (which is really just a stool outside of the BSS 3-5 range).

With the metrics described above, I try to achieve the highest HQI possible while minimizing adverse events. I average over 3 and 7 day means because the medicines take time to reach therapeutic levels due to their half life.

I am currently taking a few things:

  • 40mg daily of nexium in 2, 20mg doses
  • 2-3 librax/day
  • 1 clariten-d prn before bed for seasonal allergies
  • 5k IU vit d when i can remember to do so
  • 1 glass Metamucil mostly daily to help normalize stools since the meds arent completely working (and fiber has been shown to help the biome greatly)

Here is the output of the regression I ran from yesterday. Can you see the culprit giving me issues?

===================================================================================================================
==================== bss_adverse_events_3day ~ cardio + nexium + librax + clrtn + vitd + mtmcl ====================
===================================================================================================================
                               OLS Regression Results                              
===================================================================================
Dep. Variable:     bss_adverse_events_3day   R-squared:                       0.306
Model:                                 OLS   Adj. R-squared:                  0.236
Method:                      Least Squares   F-statistic:                     4.344
Date:                     Sun, 12 Mar 2017   Prob (F-statistic):            0.00107
Time:                             23:31:35   Log-Likelihood:                -109.56
No. Observations:                       66   AIC:                             233.1
Df Residuals:                           59   BIC:                             248.5
Df Model:                                6                                         
Covariance Type:                 nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
Intercept      2.8728      0.393      7.308      0.000       2.086       3.659
cardio        -0.5571      0.288     -1.935      0.058      -1.133       0.019
nexium        -0.8889      0.258     -3.445      0.001      -1.405      -0.373
librax         0.0720      0.174      0.414      0.681      -0.276       0.420
clrtn          1.1026      0.393      2.806      0.007       0.316       1.889
vitd          -0.0406      0.072     -0.563      0.575      -0.185       0.104
mtmcl         -0.5411      0.444     -1.218      0.228      -1.430       0.348
==============================================================================
Omnibus:                        5.193   Durbin-Watson:                   0.955
Prob(Omnibus):                  0.075   Jarque-Bera (JB):                4.918
Skew:                           0.668   Prob(JB):                       0.0855
Kurtosis:                       2.969   Cond. No.                         11.7
==============================================================================

regression for hqi 3 day mean in future

========================================================================================================
==================== hqi_3daymean ~ cardio + nexium + librax + clrtn + vitd + mtmcl ====================
========================================================================================================
                            OLS Regression Results                            
==============================================================================
Dep. Variable:           hqi_3daymean   R-squared:                       0.300
Model:                            OLS   Adj. R-squared:                  0.229
Method:                 Least Squares   F-statistic:                     4.212
Date:                Sun, 12 Mar 2017   Prob (F-statistic):            0.00136
Time:                        23:31:35   Log-Likelihood:                -19.365
No. Observations:                  66   AIC:                             52.73
Df Residuals:                      59   BIC:                             68.06
Df Model:                           6                                         
Covariance Type:            nonrobust                                         
==============================================================================
                 coef    std err          t      P>|t|      [0.025      0.975]
------------------------------------------------------------------------------
Intercept      3.1519      0.100     31.446      0.000       2.951       3.352
cardio        -0.0630      0.073     -0.858      0.394      -0.210       0.084
nexium         0.1930      0.066      2.933      0.005       0.061       0.325
librax         0.0441      0.044      0.993      0.325      -0.045       0.133
clrtn         -0.0951      0.100     -0.949      0.347      -0.296       0.105
vitd          -0.0146      0.018     -0.795      0.430      -0.051       0.022
mtmcl          0.0346      0.113      0.306      0.761      -0.192       0.261
==============================================================================
Omnibus:                        1.538   Durbin-Watson:                   0.431
Prob(Omnibus):                  0.463   Jarque-Bera (JB):                0.875
Skew:                           0.002   Prob(JB):                        0.646
Kurtosis:                       3.564   Cond. No.                         11.7
==============================================================================

I have normalized the regression by dosage so you can interpret the coef as the contribution of a dose. E.g. in the first regression table a coef of 1 means that a dose of the item contributes to 1 adverse event (linearly).

So the problem is the clariten-D I believe. It creates adverse events and does nothing for my HQI. So this week I am quitting it and will evaluate for the next 2 weeks to see if helps improve my symptoms.

3 Likes

@ejain Did my write up make sense to you? I’m likely to publish a portion of this work (not necessarily this experiment). Peer review is welcomed before I start drafting up the manuscript.

So this is awesome! I am very interested in this topic and specifically what you are trying to do. Taking a look at your data, it seems like claritin is causing you more adverse effects (since the t-test is so high) and the nexium is significantly decreasing it, but the results switch around in the 3-day mean! So what you need to do is figure out what timelag is appropriate for each variable, ie- cardio will help your stools right now, the metamucil probably tomorrow, the nexium maybe in 3 days? what you are looking for is a panel analysis, but what you could do is to regress every independent variable against the dependent using 0 day lag, 1 day lag, 2,3,4,5. Figure out which day lag is relevant for each variable, and then do a regression using each of those. You should also be normalizing your data, and how do your residuals look? Depending on your stats knowledge, you might want to feed this into a random forest model to see what comes out, with all the lag variables as well.

About your variables, you need one or two to quantify diet. Also, if the dependent variable is only ever 2,3,4 I think it’s a bit hard to guess… could you add a tiny bit more granularity there?

Or, you could also release your raw data in github and I can take a look at it. Not now, but week after next.

Good luck!

@Amit_Kohli Thanks for taking a look.

I somewhat disagree with your analysis and appreciate your time looking at it. To me, it seems the clariten stat sig (statistically significant) makes things worse for adverse events (p value of 0.007 while doing nothing stat sig for my HQI). Looking at the adverse events, the coefs are normalized by does, therefore, for each clariten i take, the number of adverse events over a 3 day period goes up by 1.1026 (the coef). For everyone nexium I take, my hqi goes up 0.1930 points. Everything else is not stat sig.

I agree with you on the point of running each variable against its own time lag, however, there is simply not enough data to so. in the manuscript I am preparing, I am looking at 3 day and 7 day. The problem with looking at everyday is that you are prone to overfitting because the system is extremely underdetermined at this point. I only have 2 months worth of data.

You should also be normalizing your data, and how do your residuals look?

I am not sure what you mean by this. I am normalizing based on number of doses and for carido, hours. For the coefs represent the following:
hour of cardio, doses of 40mg nexium, does of librax, does of clariten, doses of 5kIU vit d, and does of metamucil.

I consider myself to be intermediate in statistics, however, I have use the random forest model extensively in the past. I do not believe you will find much more difference than doing simple OLS because you have so few data points.

The residuals look fine, you can see this from the std err. They are all within an OOM of each other.

Or, you could also release your raw data in github and I can take a look at it. Not now, but week after next.

I would be happy to release the data and have a github repo already set up. I am in the midst of cleaning it up though as i prepare my manuscript. The manuscript, analysis code (i use python and pandas), and raw data will all be available there. Please ping me when you are ready to look at it and I will send you the link. In the meantime, I will finish cleaning the repository.

Thank you for your comments.

I was looking at the t-statistics, whether they are more or less than 2, and the direction. I agree that claritin is bad, but the nexium’s t-value is -3.44, it is the thing that causes the most significant reduction in bss. That’s what I was saying.

On the timelag, fair enough, but I do still think you should mix and match… exercise and claritin today, nexium in 3 days, etc… I don’t know what would work, but it would be better than nothing.

So you’re saying you don’t need to normalize because the values you’re using are fairly similar… fair enough.

When I get to it, I’ll try some other models… I’m fairly sure I’ll beat an r2 of 0.3 :wink: But yeah, few data points… maybe RF won’t be any good.

The residuals, I was talking about their distribution… to see if the model is valid everywhere.

What about diet?

I’m ‘mexindian’ on github. Raise an issue in your repo and assign it to me and I’ll get to it eventually.

I was looking at the t-statistics, whether they are more or less than 2, and the direction. I agree that claritin is bad, but the nexium’s t-value is -3.44, it is the thing that causes the most significant reduction in bss. That’s what I was saying.

Makes sense

On the timelag, fair enough, but I do still think you should mix and match… exercise and claritin today, nexium in 3 days, etc… I don’t know what would work, but it would be better than nothing.

The problem is an ideal trial would be to do 6 weeks of one thing, then a 6 week washout period, and then 6 weeks of the new treatment. I can’t afford to go 6 weeks in pain if something doesnt work. I would essentially have to “drop out” of the trial.

When I get to it, I’ll try some other models… I’m fairly sure I’ll beat an r2 of 0.3 :wink: But yeah, few data points… maybe RF won’t be any good.

I completely believe you can beat an r2 of 0.3, but you will likely overfit like crazy. You are welcomed to try though. I would validate using k-fold cross validation.

What about diet?

The current title of the manuscript is: Managing Irritable Bowel Syndrome Through Lightweight, Daily Tracking. Diet is simply too much to track with all the other metrics. I have been tested thoroughly for celiac and a food allergies. I also think that diet is very susceptible to placebo affect. I also think that the meds have the biggest effect for me personally. I have gone 6+ weeks at a time with zero issues and literally nothing has changed. This is why I didnt publish the study last year. I quit recording data because I thought I was out of the woods. This year, I am going to record daily either way.

Here is the abstract of the paper so far:

Irttiable bowel syndrome (IBS) is a multifaceted
syndrome with generally unknown etiology with few exceptions
[pimentel cite]. It primarily manifests itself through one or
more symptoms of chronic diarrhea, constipation, and abdominal
pain. Generally, it is a diagnosis of exclusion after the patient
has had a comprehensive workup. In this paper, we show how
the author, the patient, who is a 34 year old male diagnosed
with irritable bowel syndrome manifesting through symptoms of
abdominal pain and diarrhea, utilizes a smartphone application
and spreadhseet to track bowel movements, medication, exercise,
and overall functionality to assess treatment efficacy.

Apologies for the format but im cutting and pasting from tex.

@Amit_Kohli, am slowly cleaning my github repo. The raw data though is here:

@IsaacGerg

Apologies, I’m not getting any less busy… but I do know some excellent modellers. Mind if I sick them on your github repo?

1 Like

@Amit_Kohli Have at it. The data is in /data.

sorry… where’s the HQI? Or whatever dependant variable?

its the ‘mean’ column. health_analysis.py has the column disambiguation to my paper.

I’m working on a post for the blog about what’s been learned in the QS community about IBS, Crohn’s, and related issues. @IsaacGerg, did you publish this somewhere? It’s a really useful approach for others to see.

Hi Gary,

I started my PhD and abandoned the article. I am happy to publish it if you know of an appropriate forum. Right now, it is here:
https://github.com/isaacgerg/health_analysis/blob/master/manuscript/Managing_IBS_Through_Lightweight_Tracking.pdf

I think there are some minor edits that should be accomplished but the analysis is complete and has quite helped me much along my journey back to health.

Feel free to DM or give my a call if you’d like to talk more.

IG

Thank you! Reading…