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

## Call:
## coxph(formula = Surv(time.to.death, dieinfo10) ~ newen90d, data = subset(dat,
## pretipsencephalopathy == 0))
##
##
## coef exp(coef) se(coef) z p
## newen90d 0.547 1.728 0.559 0.98 0.33
##
## Likelihood ratio test=0.93 on 1 df, p=0.334
## n= 22, number of events= 14
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) 5.8095613 3.4570757 1.680484 0.09286313
## beginningportosystemicpressure -0.3030294 0.1722571 -1.759169 0.07854880
wilcox.test(beginningportosystemicpressure~newen90d, subset(dat, pretipsencephalopathy==0))
##
## Wilcoxon rank sum test with continuity correction
##
## data: beginningportosystemicpressure by newen90d
## W = 74.5, p-value = 0.0427
## 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.2399, df = 17.669, p-value = 0.03821
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 0.2634565 8.4032101
## sample estimates:
## mean in group 0 mean in group 1
## 23.08333 18.75000
ggplot(subset(dat, pretipsencephalopathy==0), aes(factor(newen90d), beginningportosystemicpressure)) + geom_boxplot(width=.3) + xlab("") + ylab("") + theme_bw()
