In [1]:
import numpy as np
import pandas as pd
import statsmodels.api as sm
Notes ------ `data` must define __getitem__ with the keys in the formula terms args and kwargs are passed on to the model instantiation. E.g., a numpy structured or rec array, a dictionary, or a pandas DataFrame. If `re_formula` is not provided, the default is a random intercept for each group. This method currently does not correctly handle missing values, so missing values should be explicitly dropped from the DataFrame before calling this method.

In [2]:
df1 = pd.read_csv("ROP10sec_clean.csv")

In [3]:
df1.isnull().sum() #how much missing data


Out[3]:
Id        0
Time      0
PI       91
PR       84
SpO2     83
StO2    104
FTOE    156
dtype: int64

In [4]:
def dropNAbc(df, col): #drop NA values by column and return only that column
    df = df[['Id', 'Time', col]].dropna(how='any')
    return df

In [5]:
def MLM(basedf, var): #random intercept, not random slope
    df = dropNAbc(basedf, var)
    model = sm.MixedLM.from_formula(var+" ~ Time", df, groups=df["Id"])
    result = model.fit()
    print result.summary()

In [6]:
def MLMslow(basedf, var): #random intercept and random slope
    #SLOW
    df = dropNAbc(basedf, var)
    model = sm.MixedLM.from_formula(var+" ~ Time", df, re_formula="Time", groups=df["Id"])
    result = model.fit()
    print result.summary()

In [11]:
MLMslow(df1, 'StO2')


              Mixed Linear Model Regression Results
=================================================================
Model:               MixedLM    Dependent Variable:    StO2      
No. Observations:    416        Method:                REML      
No. Groups:          18         Scale:                 14.5229   
Min. group size:     5          Likelihood:            -1193.5158
Max. group size:     26         Converged:             Yes       
Mean group size:     23.1                                        
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept              80.181    1.960 40.902 0.000 76.339 84.023
Time                   -0.000    0.000 -1.865 0.062 -0.001  0.000
Intercept RE           62.352   16.775                           
Intercept RE x Time RE  0.004    0.001                           
Time RE                 0.000    0.000                           
=================================================================

/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)

In [36]:
df2 = pd.read_csv('ROP24hrs_clean.csv')

In [37]:
varlst24 = ['PI', 'PR', 'SpO2', 'StO2', 'FTOE', 
            'Mild_DeSats', 'Mod_DeSats', 'Sev_DeSats',
            'PI_FuzzyEn', 'PR_FuzzyEn', 'SpO2_FuzzyEn', 'StO2_FuzzyEn', 'FTOE_FuzzyEn',
            'PI_LZ', 'PR_LZ', 'SpO2_LZ', 'StO2_LZ', 'FTOE_LZ',
            'PI_LLE', 'PR_LLE', 'SpO2_LLE', 'StO2_LLE', 'FTOE_LLE',
            'PI_Hurst', 'PR_Hurst', 'SpO2_Hurst', 'StO2_Hurst', 'FTOE_Hurst',
            'MI_PIxPR', 'MI_PIxSpO2', 'MI_PIxStO2', 'MI_PIxFTOE',
            'MI_PRxSpO2', 'MI_PRxStO2', 'MI_PRxFTOE', 'MI_SpO2xStO2',
            'xFE_PIxPR', 'xFE_PIxSpO2', 'xFE_PIxStO2', 'xFE_PIxFTOE',
            'xFE_PRxSpO2', 'xFE_PRxStO2', 'xFE_PRxFTOE', 'xFE_SpO2xStO2']

In [38]:
df2.isnull().sum()


Out[38]:
Id                0
Time              0
PI               35
PR               35
SpO2             35
StO2             35
FTOE             48
Mild_DeSats      18
Mod_DeSats       18
Sev_DeSats       18
PI_FuzzyEn       35
PR_FuzzyEn       35
SpO2_FuzzyEn     35
StO2_FuzzyEn     35
FTOE_FuzzyEn     48
PI_LZ            35
PR_LZ            35
SpO2_LZ          35
StO2_LZ          33
FTOE_LZ          46
PI_LLE           35
PR_LLE           36
SpO2_LLE         36
StO2_LLE         46
FTOE_LLE         59
PI_Hurst         41
PR_Hurst         35
SpO2_Hurst       35
StO2_Hurst       35
FTOE_Hurst       50
MI_PIxPR         37
MI_PIxSpO2       37
MI_PIxStO2       48
MI_PIxFTOE       48
MI_PRxSpO2       37
MI_PRxStO2       48
MI_PRxFTOE       48
MI_SpO2xStO2     48
xFE_PIxPR        37
xFE_PIxSpO2      37
xFE_PIxStO2      48
xFE_PIxFTOE      48
xFE_PRxSpO2      37
xFE_PRxStO2      48
xFE_PRxFTOE      48
xFE_SpO2xStO2    48
dtype: int64

In [39]:
for i in varlst24:
    MLMslow(df2, i)


              Mixed Linear Model Regression Results
================================================================
Model:                MixedLM    Dependent Variable:    PI      
No. Observations:     145        Method:                REML    
No. Groups:           18         Scale:                 0.1075  
Min. group size:      3          Likelihood:            -72.0729
Max. group size:      9          Converged:             Yes     
Mean group size:      8.1                                       
----------------------------------------------------------------
                       Coef. Std.Err.   z    P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              1.419    0.079 18.010 0.000  1.265  1.573
Time                   0.006    0.005  1.141 0.254 -0.004  0.015
Intercept RE           0.069    0.130                           
Intercept RE x Time RE 0.003    0.005                           
Time RE                0.000    0.000                           
================================================================

                Mixed Linear Model Regression Results
====================================================================
Model:                 MixedLM     Dependent Variable:     PR       
No. Observations:      145         Method:                 REML     
No. Groups:            18          Scale:                  25.8370  
Min. group size:       3           Likelihood:             -473.9429
Max. group size:       9           Converged:              Yes      
Mean group size:       8.1                                          
--------------------------------------------------------------------
                        Coef.  Std.Err.   z    P>|z|  [0.025  0.975]
--------------------------------------------------------------------
Intercept              156.375    2.590 60.379 0.000 151.299 161.451
Time                     0.066    0.067  0.974 0.330  -0.066   0.198
Intercept RE           110.570    9.044                             
Intercept RE x Time RE  -0.560    0.160                             
Time RE                  0.020    0.006                             
====================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
               Mixed Linear Model Regression Results
==================================================================
Model:                 MixedLM    Dependent Variable:    SpO2     
No. Observations:      145        Method:                REML     
No. Groups:            18         Scale:                 1.8203   
Min. group size:       3          Likelihood:            -294.6024
Max. group size:       9          Converged:             Yes      
Mean group size:       8.1                                        
------------------------------------------------------------------
                       Coef.  Std.Err.    z    P>|z| [0.025 0.975]
------------------------------------------------------------------
Intercept              94.185    0.932 101.075 0.000 92.358 96.011
Time                    0.015    0.028   0.531 0.595 -0.040  0.070
Intercept RE           14.903    4.427                            
Intercept RE x Time RE -0.206    0.105                            
Time RE                 0.009    0.004                            
==================================================================

               Mixed Linear Model Regression Results
==================================================================
Model:                 MixedLM    Dependent Variable:    StO2     
No. Observations:      145        Method:                REML     
No. Groups:            18         Scale:                 5.0226   
Min. group size:       3          Likelihood:            -357.0484
Max. group size:       9          Converged:             Yes      
Mean group size:       8.1                                        
------------------------------------------------------------------
                       Coef.  Std.Err.    z    P>|z| [0.025 0.975]
------------------------------------------------------------------
Intercept              83.439    0.833 100.131 0.000 81.806 85.072
Time                   -0.009    0.039  -0.222 0.825 -0.085  0.067
Intercept RE           10.489    2.137                            
Intercept RE x Time RE  0.106    0.068                            
Time RE                 0.014    0.004                            
==================================================================

              Mixed Linear Model Regression Results
================================================================
Model:               MixedLM    Dependent Variable:    FTOE     
No. Observations:    132        Method:                REML     
No. Groups:          16         Scale:                 6.3191   
Min. group size:     3          Likelihood:            -344.4200
Max. group size:     9          Converged:             Yes      
Mean group size:     8.2                                        
----------------------------------------------------------------
                       Coef.  Std.Err.   z   P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              11.696    1.401 8.346 0.000  8.950 14.443
Time                    0.013    0.061 0.215 0.830 -0.106  0.132
Intercept RE           28.892    5.109                          
Intercept RE x Time RE -0.759    0.190                          
Time RE                 0.042    0.010                          
================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:                MixedLM   Dependent Variable:   Mild_DeSats
No. Observations:     162       Method:               REML       
No. Groups:           18        Scale:                57.5439    
Min. group size:      9         Likelihood:           -577.1472  
Max. group size:      9         Converged:            Yes        
Mean group size:      9.0                                        
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               8.930    2.015  4.432 0.000  4.980 12.879
Time                   -0.165    0.088 -1.883 0.060 -0.338  0.007
Intercept RE           51.345    3.646                           
Intercept RE x Time RE -0.707    0.129                           
Time RE                 0.032    0.007                           
=================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:               MixedLM    Dependent Variable:    Mod_DeSats
No. Observations:    162        Method:                REML      
No. Groups:          18         Scale:                 43.7830   
Min. group size:     9          Likelihood:            -559.9818 
Max. group size:     9          Converged:             Yes       
Mean group size:     9.0                                         
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               7.338    2.108  3.481 0.001  3.206 11.471
Time                   -0.135    0.078 -1.726 0.084 -0.289  0.018
Intercept RE           63.472    4.576                           
Intercept RE x Time RE -0.637    0.132                           
Time RE                 0.029    0.006                           
=================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:               MixedLM    Dependent Variable:    Sev_DeSats
No. Observations:    162        Method:                REML      
No. Groups:          18         Scale:                 29.5624   
Min. group size:     9          Likelihood:            -535.4346 
Max. group size:     9          Converged:             Yes       
Mean group size:     9.0                                         
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               5.151    1.621  3.177 0.001  1.973  8.328
Time                   -0.020    0.098 -0.202 0.840 -0.212  0.172
Intercept RE           36.149    3.293                           
Intercept RE x Time RE -0.679    0.149                           
Time RE                 0.118    0.012                           
=================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:               MixedLM    Dependent Variable:    PI_FuzzyEn
No. Observations:    145        Method:                REML      
No. Groups:          18         Scale:                 0.0348    
Min. group size:     3          Likelihood:            16.6998   
Max. group size:     9          Converged:             Yes       
Mean group size:     8.1                                         
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.598    0.057 10.518 0.000  0.487  0.710
Time                    0.002    0.003  0.781 0.435 -0.003  0.008
Intercept RE            0.045    0.123                           
Intercept RE x Time RE -0.002    0.006                           
Time RE                 0.000    0.000                           
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
              Mixed Linear Model Regression Results
================================================================
Model:                MixedLM   Dependent Variable:   PR_FuzzyEn
No. Observations:     145       Method:               REML      
No. Groups:           18        Scale:                0.0004    
Min. group size:      3         Likelihood:           334.2978  
Max. group size:      9         Converged:            Yes       
Mean group size:      8.1                                       
----------------------------------------------------------------
                       Coef. Std.Err.   z    P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              0.066    0.004 14.971 0.000  0.058  0.075
Time                   0.000    0.000  1.547 0.122 -0.000  0.001
Intercept RE           0.000    0.007                           
Intercept RE x Time RE 0.000    0.000                           
Time RE                0.000    0.000                           
================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
             Mixed Linear Model Regression Results
===============================================================
Model:               MixedLM  Dependent Variable:  SpO2_FuzzyEn
No. Observations:    145      Method:              REML        
No. Groups:          18       Scale:               0.0022      
Min. group size:     3        Likelihood:          184.4474    
Max. group size:     9        Converged:           Yes         
Mean group size:     8.1                                       
---------------------------------------------------------------
                       Coef. Std.Err.   z   P>|z| [0.025 0.975]
---------------------------------------------------------------
Intercept              0.175    0.021 8.244 0.000  0.134  0.217
Time                   0.001    0.001 0.768 0.443 -0.002  0.004
Intercept RE           0.007    0.065                          
Intercept RE x Time RE 0.000    0.003                          
Time RE                0.000    0.000                          
===============================================================

             Mixed Linear Model Regression Results
===============================================================
Model:               MixedLM  Dependent Variable:  StO2_FuzzyEn
No. Observations:    145      Method:              REML        
No. Groups:          18       Scale:               0.0020      
Min. group size:     3        Likelihood:          208.4399    
Max. group size:     9        Converged:           Yes         
Mean group size:     8.1                                       
---------------------------------------------------------------
                       Coef. Std.Err.   z   P>|z| [0.025 0.975]
---------------------------------------------------------------
Intercept              0.119    0.016 7.443 0.000  0.088  0.150
Time                   0.000    0.001 0.318 0.751 -0.001  0.001
Intercept RE           0.004    0.042                          
Intercept RE x Time RE 0.000    0.001                          
Time RE                0.000                                   
===============================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:               MixedLM   Dependent Variable:   FTOE_FuzzyEn
No. Observations:    132       Method:               REML        
No. Groups:          16        Scale:                0.0015      
Min. group size:     3         Likelihood:           218.0343    
Max. group size:     9         Converged:            Yes         
Mean group size:     8.2                                         
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.116    0.010 11.655 0.000  0.096  0.135
Time                   -0.000    0.000 -0.119 0.905 -0.001  0.001
Intercept RE            0.001                                    
Intercept RE x Time RE  0.000                                    
Time RE                 0.000                                    
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:                 MixedLM    Dependent Variable:    PI_LZ   
No. Observations:      145        Method:                REML    
No. Groups:            18         Scale:                 0.0051  
Min. group size:       3          Likelihood:            153.6377
Max. group size:       9          Converged:             Yes     
Mean group size:       8.1                                       
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.379    0.017 22.023 0.000  0.345  0.413
Time                   -0.000    0.001 -0.440 0.660 -0.002  0.001
Intercept RE            0.003    0.031                           
Intercept RE x Time RE -0.000    0.001                           
Time RE                 0.000                                    
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:                 MixedLM    Dependent Variable:    PR_LZ   
No. Observations:      145        Method:                REML    
No. Groups:            18         Scale:                 0.0038  
Min. group size:       3          Likelihood:            172.5764
Max. group size:       9          Converged:             Yes     
Mean group size:       8.1                                       
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.379    0.016 24.344 0.000  0.349  0.410
Time                    0.001    0.001  1.582 0.114 -0.000  0.002
Intercept RE            0.003    0.029                           
Intercept RE x Time RE -0.000    0.001                           
Time RE                 0.000    0.000                           
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
             Mixed Linear Model Regression Results
===============================================================
Model:               MixedLM    Dependent Variable:    SpO2_LZ 
No. Observations:    145        Method:                REML    
No. Groups:          18         Scale:                 0.0040  
Min. group size:     3          Likelihood:            145.3521
Max. group size:     9          Converged:             Yes     
Mean group size:     8.1                                       
---------------------------------------------------------------
                       Coef. Std.Err.   z   P>|z| [0.025 0.975]
---------------------------------------------------------------
Intercept              0.347    0.037 9.326 0.000  0.274  0.420
Time                   0.000    0.001 0.292 0.771 -0.002  0.003
Intercept RE           0.023    0.152                          
Intercept RE x Time RE 0.000    0.003                          
Time RE                0.000    0.000                          
===============================================================

              Mixed Linear Model Regression Results
================================================================
Model:                MixedLM    Dependent Variable:    StO2_LZ 
No. Observations:     147        Method:                REML    
No. Groups:           18         Scale:                 0.0046  
Min. group size:      3          Likelihood:            155.9424
Max. group size:      9          Converged:             Yes     
Mean group size:      8.2                                       
----------------------------------------------------------------
                       Coef. Std.Err.   z    P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              0.199    0.020 10.147 0.000  0.160  0.237
Time                   0.000    0.001  0.361 0.718 -0.001  0.002
Intercept RE           0.005    0.039                           
Intercept RE x Time RE 0.000    0.001                           
Time RE                0.000    0.000                           
================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:                 MixedLM    Dependent Variable:    FTOE_LZ 
No. Observations:      134        Method:                REML    
No. Groups:            16         Scale:                 0.0059  
Min. group size:       3          Likelihood:            122.7863
Max. group size:       9          Converged:             Yes     
Mean group size:       8.4                                       
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.284    0.027 10.643 0.000  0.232  0.337
Time                    0.000    0.001  0.414 0.679 -0.002  0.003
Intercept RE            0.009    0.060                           
Intercept RE x Time RE -0.000    0.002                           
Time RE                 0.000    0.000                           
=================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:                 MixedLM    Dependent Variable:    PI_LLE  
No. Observations:      145        Method:                REML    
No. Groups:            18         Scale:                 0.1280  
Min. group size:       3          Likelihood:            -81.2589
Max. group size:       9          Converged:             Yes     
Mean group size:       8.1                                       
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.572    0.090  6.343 0.000  0.395  0.749
Time                   -0.001    0.005 -0.228 0.820 -0.010  0.008
Intercept RE            0.096    0.158                           
Intercept RE x Time RE -0.000    0.006                           
Time RE                 0.000    0.000                           
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
               Mixed Linear Model Regression Results
==================================================================
Model:                MixedLM     Dependent Variable:     PR_LLE  
No. Observations:     144         Method:                 REML    
No. Groups:           18          Scale:                  0.0029  
Min. group size:      2           Likelihood:             184.1889
Max. group size:      9           Converged:              Yes     
Mean group size:      8.0                                         
------------------------------------------------------------------
                       Coef.  Std.Err.    z    P>|z| [0.025 0.975]
------------------------------------------------------------------
Intercept               5.121    0.021 246.863 0.000  5.080  5.162
Time                   -0.001    0.001  -1.537 0.124 -0.002  0.000
Intercept RE            0.007    0.054                            
Intercept RE x Time RE -0.000    0.001                            
Time RE                 0.000    0.000                            
==================================================================

               Mixed Linear Model Regression Results
==================================================================
Model:                MixedLM     Dependent Variable:     SpO2_LLE
No. Observations:     144         Method:                 REML    
No. Groups:           18          Scale:                  0.0004  
Min. group size:      2           Likelihood:             313.0851
Max. group size:      9           Converged:              Yes     
Mean group size:      8.0                                         
------------------------------------------------------------------
                       Coef.  Std.Err.    z    P>|z| [0.025 0.975]
------------------------------------------------------------------
Intercept               4.562    0.011 431.555 0.000  4.541  4.583
Time                    0.000    0.000   0.150 0.881 -0.001  0.001
Intercept RE            0.002    0.039                            
Intercept RE x Time RE -0.000    0.001                            
Time RE                 0.000    0.000                            
==================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
               Mixed Linear Model Regression Results
==================================================================
Model:                MixedLM     Dependent Variable:     StO2_LLE
No. Observations:     134         Method:                 REML    
No. Groups:           18          Scale:                  0.0023  
Min. group size:      3           Likelihood:             186.9457
Max. group size:      9           Converged:              Yes     
Mean group size:      7.4                                         
------------------------------------------------------------------
                       Coef.  Std.Err.    z    P>|z| [0.025 0.975]
------------------------------------------------------------------
Intercept               4.430    0.012 377.850 0.000  4.407  4.453
Time                    0.001    0.001   1.187 0.235 -0.001  0.002
Intercept RE            0.001    0.020                            
Intercept RE x Time RE -0.000    0.001                            
Time RE                 0.000    0.000                            
==================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:                MixedLM    Dependent Variable:    FTOE_LLE 
No. Observations:     121        Method:                REML     
No. Groups:           16         Scale:                 0.3244   
Min. group size:      3          Likelihood:            -116.1768
Max. group size:      9          Converged:             Yes      
Mean group size:      7.6                                        
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               2.616    0.113 23.203 0.000  2.395  2.837
Time                   -0.003    0.007 -0.422 0.673 -0.016  0.011
Intercept RE            0.065    0.215                           
Intercept RE x Time RE  0.000    0.014                           
Time RE                 0.000    0.001                           
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:                 MixedLM    Dependent Variable:    PI_Hurst
No. Observations:      139        Method:                REML    
No. Groups:            18         Scale:                 0.0018  
Min. group size:       3          Likelihood:            223.3419
Max. group size:       9          Converged:             Yes     
Mean group size:       7.7                                       
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.769    0.009 83.284 0.000  0.751  0.787
Time                    0.000    0.001  0.897 0.370 -0.001  0.002
Intercept RE            0.001    0.014                           
Intercept RE x Time RE -0.000    0.001                           
Time RE                 0.000    0.000                           
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
               Mixed Linear Model Regression Results
==================================================================
Model:                MixedLM     Dependent Variable:     PR_Hurst
No. Observations:     145         Method:                 REML    
No. Groups:           18          Scale:                  0.0009  
Min. group size:      3           Likelihood:             283.3716
Max. group size:      9           Converged:              Yes     
Mean group size:      8.1                                         
------------------------------------------------------------------
                       Coef.  Std.Err.    z    P>|z| [0.025 0.975]
------------------------------------------------------------------
Intercept               0.791    0.006 132.160 0.000  0.779  0.803
Time                   -0.000    0.000  -0.600 0.549 -0.001  0.000
Intercept RE            0.000    0.008                            
Intercept RE x Time RE -0.000    0.000                            
Time RE                 0.000    0.000                            
==================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:               MixedLM    Dependent Variable:    SpO2_Hurst
No. Observations:    145        Method:                REML      
No. Groups:          18         Scale:                 0.0008    
Min. group size:     3          Likelihood:            271.0892  
Max. group size:     9          Converged:             Yes       
Mean group size:     8.1                                         
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.770    0.009 83.447 0.000  0.752  0.788
Time                   -0.000    0.000 -0.239 0.811 -0.001  0.001
Intercept RE            0.001    0.020                           
Intercept RE x Time RE  0.000    0.001                           
Time RE                 0.000    0.000                           
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
               Mixed Linear Model Regression Results
==================================================================
Model:                MixedLM    Dependent Variable:    StO2_Hurst
No. Observations:     145        Method:                REML      
No. Groups:           18         Scale:                 0.0010    
Min. group size:      3          Likelihood:            274.4726  
Max. group size:      9          Converged:             Yes       
Mean group size:      8.1                                         
------------------------------------------------------------------
                       Coef.  Std.Err.    z    P>|z| [0.025 0.975]
------------------------------------------------------------------
Intercept               0.805    0.006 133.909 0.000  0.793  0.817
Time                   -0.001    0.000  -1.653 0.098 -0.001  0.000
Intercept RE            0.000    0.008                            
Intercept RE x Time RE  0.000    0.000                            
Time RE                 0.000    0.000                            
==================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
               Mixed Linear Model Regression Results
==================================================================
Model:                MixedLM    Dependent Variable:    FTOE_Hurst
No. Observations:     130        Method:                REML      
No. Groups:           16         Scale:                 0.0011    
Min. group size:      3          Likelihood:            239.9633  
Max. group size:      9          Converged:             Yes       
Mean group size:      8.1                                         
------------------------------------------------------------------
                       Coef.  Std.Err.    z    P>|z| [0.025 0.975]
------------------------------------------------------------------
Intercept               0.793    0.005 149.426 0.000  0.782  0.803
Time                   -0.001    0.000  -1.208 0.227 -0.001  0.000
Intercept RE            0.000    0.006                            
Intercept RE x Time RE  0.000    0.000                            
Time RE                 0.000    0.000                            
==================================================================

              Mixed Linear Model Regression Results
================================================================
Model:                MixedLM    Dependent Variable:    MI_PIxPR
No. Observations:     143        Method:                REML    
No. Groups:           18         Scale:                 0.0381  
Min. group size:      3          Likelihood:            15.6471 
Max. group size:      9          Converged:             Yes     
Mean group size:      7.9                                       
----------------------------------------------------------------
                       Coef. Std.Err.   z    P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              0.367    0.033 11.245 0.000  0.303  0.430
Time                   0.002    0.002  0.842 0.400 -0.002  0.006
Intercept RE           0.004    0.044                           
Intercept RE x Time RE 0.000    0.002                           
Time RE                0.000    0.000                           
================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
             Mixed Linear Model Regression Results
===============================================================
Model:               MixedLM   Dependent Variable:   MI_PIxSpO2
No. Observations:    143       Method:               REML      
No. Groups:          18        Scale:                0.0109    
Min. group size:     3         Likelihood:           96.6597   
Max. group size:     9         Converged:            Yes       
Mean group size:     7.9                                       
---------------------------------------------------------------
                       Coef. Std.Err.   z   P>|z| [0.025 0.975]
---------------------------------------------------------------
Intercept              0.195    0.024 8.184 0.000  0.148  0.242
Time                   0.000    0.001 0.257 0.797 -0.002  0.003
Intercept RE           0.006    0.042                          
Intercept RE x Time RE 0.000    0.002                          
Time RE                0.000    0.000                          
===============================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
             Mixed Linear Model Regression Results
===============================================================
Model:               MixedLM   Dependent Variable:   MI_PIxStO2
No. Observations:    132       Method:               REML      
No. Groups:          16        Scale:                0.0191    
Min. group size:     3         Likelihood:           57.6267   
Max. group size:     9         Converged:            Yes       
Mean group size:     8.2                                       
---------------------------------------------------------------
                       Coef. Std.Err.   z   P>|z| [0.025 0.975]
---------------------------------------------------------------
Intercept              0.225    0.023 9.592 0.000  0.179  0.271
Time                   0.000    0.002 0.014 0.989 -0.003  0.003
Intercept RE           0.001    0.034                          
Intercept RE x Time RE 0.000    0.002                          
Time RE                0.000    0.000                          
===============================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
              Mixed Linear Model Regression Results
================================================================
Model:                MixedLM   Dependent Variable:   MI_PIxFTOE
No. Observations:     132       Method:               REML      
No. Groups:           16        Scale:                0.0500    
Min. group size:      3         Likelihood:           -15.1985  
Max. group size:      9         Converged:            Yes       
Mean group size:      8.2                                       
----------------------------------------------------------------
                       Coef. Std.Err.   z    P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              0.749    0.065 11.540 0.000  0.622  0.876
Time                   0.001    0.003  0.359 0.720 -0.005  0.007
Intercept RE           0.048    0.126                           
Intercept RE x Time RE 0.000    0.004                           
Time RE                0.000    0.000                           
================================================================

              Mixed Linear Model Regression Results
================================================================
Model:                MixedLM   Dependent Variable:   MI_PRxSpO2
No. Observations:     143       Method:               REML      
No. Groups:           18        Scale:                0.0208    
Min. group size:      3         Likelihood:           52.1188   
Max. group size:      9         Converged:            Yes       
Mean group size:      7.9                                       
----------------------------------------------------------------
                       Coef.  Std.Err.   z   P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept               0.290    0.034 8.594 0.000  0.224  0.357
Time                    0.000    0.002 0.023 0.982 -0.003  0.003
Intercept RE            0.012    0.057                          
Intercept RE x Time RE -0.000    0.002                          
Time RE                 0.000    0.000                          
================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
             Mixed Linear Model Regression Results
===============================================================
Model:               MixedLM   Dependent Variable:   MI_PRxStO2
No. Observations:    132       Method:               REML      
No. Groups:          16        Scale:                0.0372    
Min. group size:     3         Likelihood:           13.8425   
Max. group size:     9         Converged:            Yes       
Mean group size:     8.2                                       
---------------------------------------------------------------
                       Coef. Std.Err.   z   P>|z| [0.025 0.975]
---------------------------------------------------------------
Intercept              0.340    0.039 8.687 0.000  0.263  0.416
Time                   0.001    0.002 0.279 0.780 -0.004  0.005
Intercept RE           0.010    0.085                          
Intercept RE x Time RE 0.000    0.003                          
Time RE                0.000                                   
===============================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:               MixedLM    Dependent Variable:    MI_PRxFTOE
No. Observations:    132        Method:                REML      
No. Groups:          16         Scale:                 0.0924    
Min. group size:     3          Likelihood:            -51.6162  
Max. group size:     9          Converged:             Yes       
Mean group size:     8.2                                         
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               1.138    0.087 13.132 0.000  0.968  1.308
Time                   -0.000    0.004 -0.023 0.981 -0.007  0.007
Intercept RE            0.084    0.179                           
Intercept RE x Time RE -0.000    0.007                           
Time RE                 0.000    0.000                           
=================================================================

             Mixed Linear Model Regression Results
===============================================================
Model:               MixedLM  Dependent Variable:  MI_SpO2xStO2
No. Observations:    132      Method:              REML        
No. Groups:          16       Scale:               0.0129      
Min. group size:     3        Likelihood:          81.0015     
Max. group size:     9        Converged:           Yes         
Mean group size:     8.2                                       
---------------------------------------------------------------
                       Coef. Std.Err.   z   P>|z| [0.025 0.975]
---------------------------------------------------------------
Intercept              0.182    0.022 8.322 0.000  0.139  0.225
Time                   0.000    0.001 0.108 0.914 -0.003  0.003
Intercept RE           0.003    0.071                          
Intercept RE x Time RE 0.000    0.005                          
Time RE                0.000    0.000                          
===============================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:                MixedLM    Dependent Variable:    xFE_PIxPR
No. Observations:     143        Method:                REML     
No. Groups:           18         Scale:                 0.0048   
Min. group size:      3          Likelihood:            148.9777 
Max. group size:      9          Converged:             Yes      
Mean group size:      7.9                                        
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.494    0.020 24.532 0.000  0.455  0.534
Time                    0.001    0.001  1.170 0.242 -0.001  0.004
Intercept RE            0.005    0.041                           
Intercept RE x Time RE -0.000    0.002                           
Time RE                 0.000    0.000                           
=================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:                MixedLM   Dependent Variable:   xFE_PIxSpO2
No. Observations:     143       Method:               REML       
No. Groups:           18        Scale:                0.0058     
Min. group size:      3         Likelihood:           129.5095   
Max. group size:      9         Converged:            Yes        
Mean group size:      7.9                                        
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.456    0.029 15.908 0.000  0.400  0.512
Time                    0.001    0.001  0.435 0.664 -0.002  0.003
Intercept RE            0.012    0.075                           
Intercept RE x Time RE -0.000    0.003                           
Time RE                 0.000    0.000                           
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:                MixedLM   Dependent Variable:   xFE_PIxStO2
No. Observations:     132       Method:               REML       
No. Groups:           16        Scale:                0.0049     
Min. group size:      3         Likelihood:           133.7619   
Max. group size:      9         Converged:            Yes        
Mean group size:      8.2                                        
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.422    0.025 16.819 0.000  0.373  0.471
Time                    0.001    0.001  0.821 0.411 -0.001  0.003
Intercept RE            0.008    0.059                           
Intercept RE x Time RE -0.000    0.002                           
Time RE                 0.000    0.000                           
=================================================================

              Mixed Linear Model Regression Results
=================================================================
Model:                MixedLM   Dependent Variable:   xFE_PIxFTOE
No. Observations:     132       Method:               REML       
No. Groups:           16        Scale:                0.0046     
Min. group size:      3         Likelihood:           139.4586   
Max. group size:      9         Converged:            Yes        
Mean group size:      8.2                                        
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.469    0.022 21.216 0.000  0.425  0.512
Time                    0.000    0.001  0.429 0.668 -0.002  0.003
Intercept RE            0.006    0.047                           
Intercept RE x Time RE -0.000    0.002                           
Time RE                 0.000    0.000                           
=================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
              Mixed Linear Model Regression Results
================================================================
Model:               MixedLM   Dependent Variable:   xFE_PRxSpO2
No. Observations:    143       Method:               REML       
No. Groups:          18        Scale:                0.0038     
Min. group size:     3         Likelihood:           162.3315   
Max. group size:     9         Converged:            Yes        
Mean group size:     7.9                                        
----------------------------------------------------------------
                       Coef. Std.Err.   z    P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              0.491    0.021 23.839 0.000  0.450  0.531
Time                   0.001    0.001  1.284 0.199 -0.000  0.002
Intercept RE           0.006    0.047                           
Intercept RE x Time RE 0.000    0.001                           
Time RE                0.000    0.000                           
================================================================

              Mixed Linear Model Regression Results
================================================================
Model:               MixedLM   Dependent Variable:   xFE_PRxStO2
No. Observations:    132       Method:               REML       
No. Groups:          16        Scale:                0.0035     
Min. group size:     3         Likelihood:           158.4486   
Max. group size:     9         Converged:            Yes        
Mean group size:     8.2                                        
----------------------------------------------------------------
                       Coef. Std.Err.   z    P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              0.455    0.015 29.756 0.000  0.425  0.485
Time                   0.001    0.001  1.482 0.138 -0.000  0.003
Intercept RE           0.002    0.026                           
Intercept RE x Time RE 0.000    0.001                           
Time RE                0.000    0.000                           
================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/base/model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  "Check mle_retvals", ConvergenceWarning)
              Mixed Linear Model Regression Results
================================================================
Model:               MixedLM   Dependent Variable:   xFE_PRxFTOE
No. Observations:    132       Method:               REML       
No. Groups:          16        Scale:                0.0035     
Min. group size:     3         Likelihood:           163.2600   
Max. group size:     9         Converged:            Yes        
Mean group size:     8.2                                        
----------------------------------------------------------------
                       Coef. Std.Err.   z    P>|z| [0.025 0.975]
----------------------------------------------------------------
Intercept              0.489    0.013 37.001 0.000  0.463  0.515
Time                   0.001    0.001  1.179 0.238 -0.001  0.002
Intercept RE           0.001    0.021                           
Intercept RE x Time RE 0.000    0.001                           
Time RE                0.000    0.000                           
================================================================
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
/Users/John/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/statsmodels/regression/mixed_linear_model.py:1717: ConvergenceWarning: The MLE may be on the boundary of the parameter space.
  warnings.warn(msg, ConvergenceWarning)
              Mixed Linear Model Regression Results
=================================================================
Model:              MixedLM   Dependent Variable:   xFE_SpO2xStO2
No. Observations:   132       Method:               REML         
No. Groups:         16        Scale:                0.0028       
Min. group size:    3         Likelihood:           164.4749     
Max. group size:    9         Converged:            Yes          
Mean group size:    8.2                                          
-----------------------------------------------------------------
                       Coef.  Std.Err.   z    P>|z| [0.025 0.975]
-----------------------------------------------------------------
Intercept               0.385    0.024 15.932 0.000  0.338  0.432
Time                   -0.000    0.001 -0.204 0.839 -0.001  0.001
Intercept RE            0.008    0.072                           
Intercept RE x Time RE  0.000    0.001                           
Time RE                 0.000    0.000                           
=================================================================


In [7]:
# DeSats -> generalized mixed models

# from raw data, 
# get an output of .csv thta has -3:0 everything, during, then (exam end -> data end) everything