Doc du lieu

t = t = "C:\\Users\\Administrator\\Desktop\\Chi VA\\Chi VA\\Data\\data VA 14.9.19 moi.csv"
va = read.csv(t)
library(ggplot2)
library(ggpubr)
## Loading required package: magrittr

Tao tep con

va1 = subset(va, Group == 1)
va2 = subset(va, Group == 2)
va3 = subset(va, Group == 3)

Ve bieu do eGFR theo thoi gian

p1 = ggplot(data = va, aes(x = Time, y = eGFR)) + geom_point(color = "#00AFBB", size = 1) + scale_x_continuous(name = "Time (Months)", breaks = seq(0,69,3)) + scale_y_continuous(name = "eGFR (ml/min/1.73m2)", breaks = seq(0,175,25))
p1
## Warning: Removed 279 rows containing missing values (geom_point).

Them duong bieu dien xu huong eGFR

p1+ stat_smooth(color = "#FC4E07", fill = "#FC4E07",method = "loess")
## Warning: Removed 279 rows containing non-finite values (stat_smooth).
## Warning: Removed 279 rows containing missing values (geom_point).

Ve bieu do C0 theo thoi gian

p2 = ggplot(data = va, aes(x = Time, y = Pre.dose.concentration..C0.)) + geom_point(color = "#00AFBB", size = 1) + scale_x_continuous(name = "Time (Months)", breaks = seq(0,69,3)) + scale_y_continuous(name = "Tacrolimus trough level (mg/ml)", breaks = seq(0,35,5))
p2 + stat_smooth(color = "#FC4E07", fill = "#FC4E07",method = "loess")
## Warning: Removed 940 rows containing non-finite values (stat_smooth).
## Warning: Removed 940 rows containing missing values (geom_point).

Ve bieu do C0 giai doan 1

p3 = ggplot(data = va1, aes(x = Time.1, y = Pre.dose.concentration..C0.)) + geom_point(color = "#00AFBB", size = 1) + scale_x_continuous(name = "Time (Days)", breaks = seq(0,90,15)) + scale_y_continuous(name = "Tacrolimus trough level (mg/ml)", breaks = seq(0,35,5)) + ggtitle("Group 1")
fig1 = p3 + stat_smooth(color = "#FC4E07", fill = "#FC4E07",method = "loess") + geom_hline(yintercept=c(10,15), linetype="dashed", color = "red", size=1)
fig1
## Warning: Removed 669 rows containing non-finite values (stat_smooth).
## Warning: Removed 669 rows containing missing values (geom_point).

Ve bieu do C0 giai doan 2

p4 = ggplot(data = va2, aes(x = Time, y = Pre.dose.concentration..C0.)) + geom_point(color = "#00AFBB", size = 1) + scale_x_continuous(name = "Time (Months)", breaks = seq(3,12,1)) + scale_y_continuous(name = "Tacrolimus trough level (mg/ml)", breaks = seq(0,30,5)) +ggtitle("Group 2")
fig2 = p4 + stat_smooth(color = "#FC4E07", fill = "#FC4E07",method = "loess") + geom_hline(yintercept=c(8,12), linetype="dashed", color = "red", size=1)
fig2
## Warning: Removed 97 rows containing non-finite values (stat_smooth).
## Warning: Removed 97 rows containing missing values (geom_point).

Ve bieu do C0 giai doan 3

p5 = ggplot(data = va3, aes(x = Time, y = Pre.dose.concentration..C0.)) + geom_point(color = "#00AFBB", size = 1) + scale_x_continuous(name = "Time (Months)", breaks = seq(12,69,3)) + scale_y_continuous(name = "Tacrolimus trough level (mg/ml)", breaks = seq(0,30,5)) +ggtitle("Group 3")
fig3 = p5 + stat_smooth(color = "#FC4E07", fill = "#FC4E07",method = "loess") + geom_hline(yintercept=c(5,10), linetype="dashed", color = "red", size=1)
fig3
## Warning: Removed 174 rows containing non-finite values (stat_smooth).
## Warning: Removed 174 rows containing missing values (geom_point).

Gop bieu do Nhom 1, 2 va 3

library(gridExtra)
grid.arrange(fig1, fig2, fig3 , ncol = 1, nrow = 3)
## Warning: Removed 669 rows containing non-finite values (stat_smooth).
## Warning: Removed 669 rows containing missing values (geom_point).
## Warning: Removed 97 rows containing non-finite values (stat_smooth).
## Warning: Removed 97 rows containing missing values (geom_point).
## Warning: Removed 174 rows containing non-finite values (stat_smooth).
## Warning: Removed 174 rows containing missing values (geom_point).