1. The mortality differences between patient required revision (include thrombosed) and do not required revision?

2. Kaplan meier survival curve for 90day newonset encephalopathy (exclude pre-tips-encephalopathy).

3. Any thing can predict 90day newonset encephalopathy? (initial tips diameter? Begininig portosystemic pressure? Post portosystemic pressure? Or changes in portosystemic pressure? Pre MELD)

fit <- glm(newen90d~beginningportosystemicpressure, subset(dat, pretipsencephalopathy==0), family="binomial" )
summary(fit)$coeff
##                                  Estimate Std. Error   z value  Pr(>|z|)
## (Intercept)                     6.3493124  3.4959249  1.816204 0.0693391
## beginningportosystemicpressure -0.3210636  0.1720536 -1.866068 0.0620319
wilcox.test(beginningportosystemicpressure~newen90d, subset(dat, pretipsencephalopathy==0))
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  beginningportosystemicpressure by newen90d
## W = 83.5, p-value = 0.03753
## alternative hypothesis: true location shift is not equal to 0
t.test(beginningportosystemicpressure~newen90d, subset(dat, pretipsencephalopathy==0))
## 
##  Welch Two Sample t-test
## 
## data:  beginningportosystemicpressure by newen90d
## t = 2.3945, df = 18.982, p-value = 0.02713
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.5487573 8.1734649
## sample estimates:
## mean in group 0 mean in group 1 
##        23.25000        18.88889
ggplot(subset(dat, pretipsencephalopathy==0), aes(factor(newen90d), beginningportosystemicpressure)) + geom_boxplot(width=.3) + xlab("") + ylab("") + theme_bw()

4. Kaplan meier survival curve for TIPS patency (only 4 thrombosed).

## Call: survfit(formula = Surv(time.to.thrombosed, thrombosed) ~ 1, data = dat)
## 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##     2     30       1    0.967  0.0328        0.905            1
##   136     18       1    0.913  0.0607        0.801            1
##   512     14       1    0.848  0.0844        0.697            1
##  1182      9       1    0.754  0.1163        0.557            1

5. Kaplan meier survival curve for TIPS revision (including thrombosed).

## Call: survfit(formula = Surv(time.to.revision, revision10) ~ 1, data = dat)
## 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##     2     30       2    0.933  0.0455        0.848        1.000
##     3     28       1    0.900  0.0548        0.799        1.000
##     4     27       1    0.867  0.0621        0.753        0.997
##    23     22       1    0.827  0.0706        0.700        0.978
##    41     19       1    0.784  0.0792        0.643        0.955
##    50     17       1    0.738  0.0869        0.585        0.929
##    67     16       1    0.692  0.0929        0.531        0.900
##   120     14       1    0.642  0.0986        0.475        0.867
##   136     13       1    0.593  0.1026        0.422        0.832
##   512     10       1    0.533  0.1081        0.359        0.794
##   913      7       1    0.457  0.1165        0.278        0.753
##  1182      6       1    0.381  0.1194        0.206        0.704