OBJECTIVE 1: Recovery of muscle strength over time!

Relationship of muscle strength among each time points

The correlation plot of muscle strength among each time points:

## Registered S3 methods overwritten by 'lme4':
##   method                          from
##   cooks.distance.influence.merMod car 
##   influence.merMod                car 
##   dfbeta.influence.merMod         car 
##   dfbetas.influence.merMod        car

Our objective is to see how muscle strength changes over time. The process of transforming wide to long format and data cleaning can be accessed here

Shown below is the first 50 rows:

##    PatID Levels      Age Gender Group_paresis Time Muscle_strength
## 1      1      5 60.94795      2             1    1               4
## 2      2      5 55.64932      2             1    1               1
## 3      3      5 55.17260      2             2    1               3
## 4      4      5 24.33151      2             2    1               3
## 5      5      6 38.06301      2             1    1               4
## 6      6      5 63.18904      1             2    1               3
## 7      7      6 30.71233      1             1    1               4
## 8      8      6 22.65205      1             2    1               3
## 9      9      6 48.30137      1             2    1               3
## 10    10      5 32.92603      1             2    1               3
## 11    11      5 45.87945      2             3    1               2
## 12    12      5 41.32877      2             2    1               3
## 13    13      6 39.54795      1             2    1               4
## 14    14      6 29.91233      2             2    1               4
## 15    15      4 51.95616      2             1    1               3
## 16    16      6 37.29863      2             3    1               4
## 17    17      5 62.91233      2             1    1               0
## 18    18      3 69.37808      2             1    1               3
## 19    19      5 60.11233      2             2    1               4
## 20    20      5 53.11781      1             1    1               3
## 21    21      5 39.23836      2             1    1               1
## 22    22      4 39.84658      2             2    1               3
## 23    23      6 47.86575      2             1    1               3
## 24    24      5 35.90685      1             3    1               3
## 25    25      5 57.59452      1             2    1               3
## 26    26      6 42.68219      2             1    1               4
## 27    27      4 57.88219      2             3    1               4
## 28    28      5 31.65205      1             1    1               4
## 29    29      6 44.64110      2             2    1               4
## 30    30      6 35.95342      2             1    1               3
## 31    31      6 41.29589      2             3    1               4
## 32    32      6 37.24384      1             3    1               2
## 33    33      6 43.40822      2             3    1               3
## 34    34      4 42.25205      2             1    1               3
## 35    35      3 70.41096      2             1    1               4
## 36    36      5 55.23836      2             2    1               3
## 37    37      5 63.49041      2             3    1               4
## 38    38      6 29.10685      1             1    1               0
## 39    39      5 37.72329      2             2    1               1
## 40    40      5 43.95890      2             2    1               3
## 41    41      4 63.14795      2             2    1               3
## 42    42      6 30.51507      2             1    1               3
## 43    43      6 31.26027      1             1    1               4
## 44    44      5 73.86849      1             2    1               4
## 45    45      5 39.71507      1             2    1               2
## 46    46      5 61.87671      2             1    1               4
## 47    47      3 86.89315      2             1    1               4
## 48    48      5 36.37534      1             1    1               2
## 49    49      5 65.84932      2             2    1               3
## 50    50      5 62.21370      2             1    1               4

Slopes of recovery over time

Next, I used lmer function to extract the “slope” of each individuals’ muscle stregth over time (as shown as the first 50 individuals):

(The “intercept” column stands for the estimated muscle strenght at 1st time point (preop), the “Time” column stands for the slope of muscle strength over time)

library(lme4)
Lumbar_lmer <- lmer(Muscle_strength ~ Time + (1+Time|PatID), REML = FALSE, 
                    data = Lumbar_long)
coef_lumbar <- coef(Lumbar_lmer)$PatID[1:2]
head(coef_lumbar, 50)
##    (Intercept)      Time
## 1     3.733393 0.3316596
## 2     2.589292 0.2960402
## 3     3.083549 0.3090896
## 4     3.550311 0.3376512
## 5     3.733393 0.3316596
## 6     2.191268 0.2286984
## 7     3.733393 0.3316596
## 8     3.550311 0.3376512
## 9     3.550311 0.3376512
## 10    2.630535 0.2727720
## 11    1.582667 0.1828603
## 12    2.360603 0.2304628
## 13    3.733393 0.3316596
## 14    3.138540 0.2780654
## 15    3.380976 0.3358867
## 16    3.138540 0.2780654
## 17    2.406210 0.3020317
## 18    3.550311 0.3376512
## 19    3.733393 0.3316596
## 20    3.225389 0.3263662
## 21    3.184146 0.3496343
## 22    2.955457 0.2840570
## 23    3.550311 0.3376512
## 24    2.360603 0.2304628
## 25    3.380976 0.3358867
## 26    3.733393 0.3316596
## 27    3.408471 0.3203746
## 28    3.733393 0.3316596
## 29    3.564058 0.3298951
## 30    3.550311 0.3376512
## 31    3.138540 0.2780654
## 32    1.582667 0.1828603
## 33    2.360603 0.2304628
## 34    3.225389 0.3263662
## 35    3.733393 0.3316596
## 36    2.360603 0.2304628
## 37    3.266632 0.3030980
## 38    2.831728 0.3538614
## 39    1.358342 0.2121200
## 40    2.360603 0.2304628
## 41    2.360603 0.2304628
## 42    3.550311 0.3376512
## 43    3.733393 0.3316596
## 44    3.733393 0.3316596
## 45    2.772375 0.2900486
## 46    3.733393 0.3316596
## 47    3.733393 0.3316596
## 48    3.367228 0.3436427
## 49    2.955457 0.2840570
## 50    3.733393 0.3316596

As you can see from the first 50 individuals from our dataset, they all have positive slope -> This indicates all of them improve over time.

To double check, we can refer to this graph below (showing the slope of recovery for the first 50 individuals):

Now, we merge these intercepts and slope to the real data (again this data wrangling process can be accessed via github here), and let the URP decide whether the recovery over time is influenced by preop muscle strenght and groups of paresis (among other variables such as age, sex, ect) (For this URP, we controlled for Bonferonni and prune the tree with maximum depth = 2):

library(party)
library(expss)
lumbar_coef = apply_labels(lumbar_coef, Preop_muscle_strength="Pre-operation muscle strength", 
                           Group_paresis="Groups of Paralysis",  Duration_paresis="Duration of Paralysis")

URP_slope<-use_labels(lumbar_coef,ctree(Slope~Duration_initial+Myotoma+Duration_paresis+Age+Levels+Preop_muscle_strength, 
                 data=..data,controls=ctree_control(testtype = "Bonferroni", maxdepth = 2)))

plot(URP_slope, main="Decision Tree for Slope of Recovery")

We then extracted the mean and median out of each node from previous URP then plotted those in a graph:

## # A tibble: 4 x 3
##   node_slope  mean median
##        <int> <dbl>  <dbl>
## 1          3 0.311  0.340
## 2          4 0.198  0.208
## 3          6 0.332  0.338
## 4          7 0.293  0.286

OBJECTIVE 2: Dichotomy of Muscle strength at 3 months

As previously discussed, we would like to know how well individuals recovered at 3 months. Initially, we talked about dichotomizing the muscle strength. However, since the distance between 4 and 5 scores is NOT the same as the distance between 2 and 3, I decided to arrange this into 3 factors instead: severe (0-2/5), moderate (3-4/5), recovered (5/5):

lumbar_coef$Muscle_Factor <- as.factor(ifelse(lumbar_coef$Postop_muscle_strength_3m<3, "severe", 
                                              ifelse(lumbar_coef$Postop_muscle_strength_3m == 5, "recovered", "moderate")))

lumbar_coef$Muscle_Factor2 <- relevel(lumbar_coef$Muscle_Factor, ref = "severe")

lumbar_coef_noNA <-subset(lumbar_coef, !is.na(Muscle_Factor2))

URP_muscle <- use_labels(lumbar_coef_noNA, ctree(Muscle_Factor2~Preop_muscle_strength+Duration_initial+Myotoma+Duration_paresis+Age+Levels, 
                                             data=..data, controls = ctree_control(testtype = "Bonferroni", maxdepth = 2)))

plot(URP_muscle, main="Decision Tree for Muscle Groups")

We extracted the nodes from previous URP to plot the barplot

#OBJECTIVE 3: Muscle factor at last follow-up

Sensitivity Analysis (Outcomes for only pre-op muscle of 4)

plot(use_labels(lumbar_coef_noNA,ctree(Muscle_Factor3~Duration_paresis,
                                       data=subset(..data, Preop_muscle_strength==4))), 
     main="Time of Surgery in Mild Pre-op Muscle")

plot(use_labels(lumbar_coef_noNA,ctree(Slope~Duration_paresis,
                                       data=subset(..data, Preop_muscle_strength==4))), 
     main="Time of Surgery in Mild Pre-op Muscle")

Sensitivity Analysis for last follow-up

plot(use_labels(lumbar_coef_noNA,ctree(Muscle_Factor_last~Duration_paresis,
                                       data=subset(..data, Preop_muscle_strength==4))), 
     main="Time of Surgery in Mild Pre-op Muscle in last follow up")

Additional regession analyses

## 
## Call:
## glm(formula = Group_paresis4 ~ Muscle_Factor_last, family = binomial, 
##     data = lumbar_coef)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6651  -0.6152   0.7585   0.7585   1.8750  
## 
## Coefficients:
##                             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                  -1.5686     0.2458  -6.382 1.75e-10 ***
## Muscle_Factor_lastrecovered   2.6672     0.2850   9.357  < 2e-16 ***
## Muscle_Factor_lastsevere    -14.9975   581.9751  -0.026    0.979    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 536.12  on 388  degrees of freedom
## Residual deviance: 394.56  on 386  degrees of freedom
##   (1 observation deleted due to missingness)
## AIC: 400.56
## 
## Number of Fisher Scoring iterations: 15
##                 (Intercept) Muscle_Factor_lastrecovered 
##                2.083333e-01                1.440000e+01 
##    Muscle_Factor_lastsevere 
##                3.066826e-07

This result indicates that the odds of earlier surgery for muscle recovered at last time point is 44% compared to later time point.

## 
## Call:
## glm(formula = Group_paresis4 ~ Muscle_Factor3, family = binomial, 
##     data = lumbar_coef)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7438  -0.4854   0.7024   0.7024   2.0963  
## 
## Coefficients:
##                         Estimate Std. Error z value Pr(>|z|)    
## (Intercept)              -2.0794     0.3750  -5.545 2.93e-08 ***
## Muscle_Factor3recovered   3.3533     0.4097   8.185 2.73e-16 ***
## Muscle_Factor3unchanged   1.4553     0.4929   2.952  0.00316 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 449.25  on 329  degrees of freedom
## Residual deviance: 331.66  on 327  degrees of freedom
##   (60 observations deleted due to missingness)
## AIC: 337.66
## 
## Number of Fisher Scoring iterations: 4
##             (Intercept) Muscle_Factor3recovered Muscle_Factor3unchanged 
##                0.125000               28.595745                4.285714

Similarly, this indicates that the odds of earlier surgery for muscle recovered at 3m time point is 28.5 times the odds of later surgery.

## 
## Call:
## lm(formula = Slope ~ Duration_paresis, data = lumbar_coef)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.19017 -0.02046  0.02615  0.03147  0.16535 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       0.3075056  0.0027145  113.28  < 2e-16 ***
## Duration_paresis -0.0006636  0.0001363   -4.87 1.62e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.04952 on 388 degrees of freedom
## Multiple R-squared:  0.05761,    Adjusted R-squared:  0.05518 
## F-statistic: 23.72 on 1 and 388 DF,  p-value: 1.625e-06

This also shows that the earlier the sugery, the better for the slope of outcome.