#libraries
library(ggplot2)
library(dplyr)
library(knitr)
#theme
my_theme<-function(x){theme_bw()+
theme(text = element_text(size=20))+
theme(axis.line.y = element_line(size = 2.0))+
theme(axis.line.x = element_line(size = 2.0))+
theme(axis.ticks = element_line(size = 1.5,colour="black"))+
theme(axis.ticks.length= unit(0.45, "cm"))+
theme(axis.title.y =element_text(vjust=1.2))+
theme(axis.title.x =element_text(vjust=-0.2))+
theme(axis.text=element_text(colour="black"))+
theme(panel.background = element_rect(fill ="white"))}
#40 mg dose 10 subjects IDs 1 through 10
sim40_10n<-read.table("C:\\Heller\\PHAR7380\\sandbox\\q2w40mg_10n.res",skip=1,header=T)
#PK Profile
ggplot(data=sim40_10n%>%filter(CMT==2),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## i Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
## i Please use the `linewidth` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
#PD Profile
ggplot(data=sim40_10n%>%filter(CMT==3),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#Create summary files for PK and PD 10 subjects IDs 1 through 10
sim40_10nsum2<-sim40_10n%>%filter(CMT==2)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
sim40_10nsum3<-sim40_10n%>%filter(CMT==3)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
#plots for 40mg dose PK using sim40_10n
ggplot(data=sim40_10n%>%filter(CMT==2),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_10nsum2
ggplot(data=sim40_10nsum2,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim40_10nsum2,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim40_10nsum2,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Conc(mg/L)ah")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#plots for 40mg dose CRP using sim40_10n
ggplot(data=sim40_10n%>%filter(CMT==3),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CD4 count/mL")
#labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)a")+
#scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_10nsum3
ggplot(data=sim40_10nsum3,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim40_10nsum3,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim40_10nsum3,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CRP (mg/L)")
labs(x="Time after dose (week)",y="CRP (mg/L)")+geom_hline(yintercept=8, linetype="dashed", color = "red")+scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#8040 dose n=10
sim8040_10n<-read.table("C:\\Heller\\PHAR7380\\sandbox\\ld80mgq2w40_n10.res",skip=1,header=T)
#PK Profile
ggplot(data=sim8040_10n%>%filter(CMT==2),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#PD Profile
ggplot(data=sim8040_10n%>%filter(CMT==3),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#PK Profile
ggplot(data=sim8040_10n%>%filter(CMT==2),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#PD Profile
ggplot(data=sim8040_10n%>%filter(CMT==3),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
sim8040_10nsum2<-sim8040_10n%>%filter(CMT==2)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
sim8040_10nsum3<-sim8040_10n%>%filter(CMT==3)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
#plots 8040 dose n=10
ggplot(data=sim8040_10n%>%filter(CMT==3),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CD4 count/mL")
#labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)a")+
#scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_10nsum3
ggplot(data=sim8040_10nsum3,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim40_10nsum3,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim40_10nsum3,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CRP (mg/L)")
labs(x="Time after dose (week)",y="CRP (mg/L)")+geom_hline(yintercept=8, linetype="dashed", color = "red")+scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#40 mg dose n=100 subjects IDs 1 through 100
sim40_100n<-read.table("C:\\Heller\\PHAR7380\\sandbox\\q2w40mg_100n.res",skip=1,header=T)
#PK Profile
ggplot(data=sim40_100n%>%filter(CMT==2),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#PD Profile
ggplot(data=sim40_100n%>%filter(CMT==3),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#Create summary files for PK and PD 100 subjects IDs 1 through 100
sim40_100nsum2<-sim40_100n%>%filter(CMT==2)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
sim40_100nsum3<-sim40_10n%>%filter(CMT==3)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
#plots for 40mg dose PK using sim40_100n
ggplot(data=sim40_100n%>%filter(CMT==2),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_10nsum2
ggplot(data=sim40_100nsum2,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim40_100nsum2,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim40_100nsum2,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Conc(mg/L)ah")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#plots for 40mg dose CRP using sim40_100n
ggplot(data=sim40_100n%>%filter(CMT==3),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CD4 count/mL")
#labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)a")+
#scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_100nsum3
ggplot(data=sim40_100nsum3,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim40_100nsum3,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim40_100nsum3,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CRP (mg/L)")
labs(x="Time after dose (week)",y="CRP (mg/L)")+geom_hline(yintercept=8, linetype="dashed", color = "red")+scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#8040 mg dose n=100 subjects IDs 1 through 100
sim8040_100n<-read.table("C:\\Heller\\PHAR7380\\sandbox\\ld80mgq2w40_n100.res",skip=1,header=T)
#PK Profile
ggplot(data=sim8040_100n%>%filter(CMT==2),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#PD Profile
ggplot(data=sim8040_100n%>%filter(CMT==3),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#Create summary files for 8040 PK and PD 100 subjects IDs 1 through 100
sim8040_100nsum2<-sim8040_100n%>%filter(CMT==2)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
sim8040_100nsum3<-sim8040_10n%>%filter(CMT==3)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
#plots for 8040mg dose PK using sim8040_100n
ggplot(data=sim8040_100n%>%filter(CMT==2),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_10nsum2
ggplot(data=sim8040_100nsum2,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim8040_100nsum2,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim8040_100nsum2,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Conc(mg/L)ah")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#plots for 8040mg dose CRP using sim8040_100n
ggplot(data=sim8040_100n%>%filter(CMT==3),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CD4 count/mL")
#labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)a")+
#scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_100nsum3
ggplot(data=sim8040_100nsum3,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim8040_100nsum3,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim8040_100nsum3,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CRP (mg/L)")
labs(x="Time after dose (week)",y="CRP (mg/L)")+geom_hline(yintercept=8, linetype="dashed", color = "red")+scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#16040 mg dose n=100 subjects IDs 1 through 100
sim16040_100n<-read.table("C:\\Heller\\PHAR7380\\sandbox\\ld160mgq2w40_n100.res",skip=1,header=T)
#PK Profile
ggplot(data=sim16040_100n%>%filter(CMT==2),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#PD Profile
ggplot(data=sim16040_100n%>%filter(CMT==3),aes(TIME/7,IPRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#Create summary files for 16040 PK and PD 100 subjects IDs 1 through 100
sim16040_100nsum2<-sim16040_100n%>%filter(CMT==2)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
sim16040_100nsum3<-sim16040_100n%>%filter(CMT==3)%>%group_by(TIME)%>%summarise(cmed=median(IPRED),cu975=quantile(IPRED,0.975),cu025=quantile(IPRED,0.025))
#plots for 16040mg dose PK using sim16040_100n
ggplot(data=sim16040_100n%>%filter(CMT==2),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_10nsum2
ggplot(data=sim16040_100nsum2,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim16040_100nsum2,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim16040_100nsum2,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Conc(mg/L)ah")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#plots for 8040mg dose CRP using sim8040_100n
ggplot(data=sim16040_100n%>%filter(CMT==3),aes(TIME/7,PRED))+
geom_line(size=0.5)+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CD4 count/mL")
#labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)a")+
#scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#median and 95% CI using sim40_100nsum3
ggplot(data=sim16040_100nsum3,aes((TIME/7),cmed*1))+
geom_line(size=0.5)+
geom_line(data=sim16040_100nsum3,aes((TIME/7),cu975),size=0.5,linetype="dashed")+
geom_line(data=sim16040_100nsum3,aes((TIME/7),cu025),size=0.5,linetype="dashed")+
#scale_x_continuous(limits = c(0,6))+
theme_bw()+
my_theme()+
#labs(x="Time after dose (week)",y="CRP (mg/L)")
labs(x="Time after dose (week)",y="CRP (mg/L)")+geom_hline(yintercept=8, linetype="dashed", color = "red")+scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
```#{r message=FALSE}
#80 mg dose `#
{r message=FALSE}
sim80<-read.table(“/work/ac0837/PHAR7380/week11/project/q2w80mg.res”,skip=1,header=T)
#PK Profile ggplot(data=sim80%>%filter(CMT==2),aes(TIME/7,PRED))+
geom_line(size=0.5)+ theme_bw()+ my_theme()+ labs(x=“Time after dose
(week)”,y=“UNT763 Concentration (mg/L)”)+ scale_x_continuous(breaks =
c(0,2,4,6,8,10,12,14,16),limits = c(0,16)) #PD Profile
ggplot(data=sim80%>%filter(CMT==3),aes(TIME/7,PRED))+
geom_line(size=0.5)+ theme_bw()+ my_theme()+ labs(x=“Time after dose
(week)”,y=“CRP (mg/L)”)+ geom_hline(yintercept=8, linetype=“dashed”,
color = “red”)+ scale_x_continuous(breaks =
c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#80 mg loadig dose, then q2w 40 mg dose md
#```{r message=FALSE}
sim8040<-read.table("/work/ac0837/PHAR7380/week11/project/ld80mgq2w40mgmd.res",skip=1,header=T)
#PK Profile
ggplot(data=sim8040%>%filter(CMT==2),aes(TIME/7,PRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#PD Profile
ggplot(data=sim8040%>%filter(CMT==3),aes(TIME/7,PRED))+
geom_line(size=0.5)+
theme_bw()+
my_theme()+
labs(x="Time after dose (week)",y="CRP (mg/L)")+
geom_hline(yintercept=8, linetype="dashed", color = "red")+
scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))
#160 mg loadig dose, then q2w 40 mg dose md
#{r message=FALSE} sim16040<-read.table("/work/ac0837/PHAR7380/week11/project/ld160mgq2w40mgmd.res",skip=1,header=T) #PK Profile ggplot(data=sim16040%>%filter(CMT==2),aes(TIME/7,PRED))+ geom_line(size=0.5)+ theme_bw()+ my_theme()+ labs(x="Time after dose (week)",y="UNT763 Concentration (mg/L)")+ scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16)) #PD Profile ggplot(data=sim16040%>%filter(CMT==3),aes(TIME/7,PRED))+ geom_line(size=0.5)+ theme_bw()+ my_theme()+ labs(x="Time after dose (week)",y="CRP (mg/L)")+ geom_hline(yintercept=8, linetype="dashed", color = "red")+ scale_x_continuous(breaks = c(0,2,4,6,8,10,12,14,16),limits = c(0,16))