knitr::opts_chunk$set(echo = T,
comment=NA,
tidy = T,
warning = F,
message = F,
fig.align = "center")LL_2cp<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/2 cp/Train/LogLikelihood/logLikelihood.txt", header = T, sep = ",")
LL_2cp$Compartment<-"2 cp"
LL_3cp<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/3 cp/Training/LogLikelihood/logLikelihood.txt", header = T, sep = ",")
LL_3cp$Compartment<-"3 cp"
LL_3cp_Cl_urea<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/3 cp/Training Cl-Urée/LogLikelihood/logLikelihood.txt", header = T, sep = ",")
LL_comparison_cp<-bind_rows(LL_2cp, LL_3cp)
LL_comparison_cp<-pivot_wider(LL_comparison_cp, names_from= Compartment, values_from = importanceSampling)
datatable(LL_comparison_cp,
extensions = 'Buttons',
options = list(dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel')))Nous pouvons voir que le critère d’Akaike (AIC) est significativement plus faible avec un modèle structural comportant 3 compartiments.
Regardons les corrélations pouvant exister entre les paramètres individuels et les covariables :
## correlation
EstimatedIndividualParameters_training_cov<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/3 cp/Training Cl-Urée/IndividualParameters/estimatedIndividualParameters.txt", header = T, sep = ",")
Test_cov_cl_V1_V2<-EstimatedIndividualParameters_training_cov %>% select(Cl_mode, V1_mode, V2_mode, BSA, HT, PROT, UREE, WT)
Test_cov_V3_Q2_Q3<-EstimatedIndividualParameters_training_cov %>% select(V3_mode, Q2_mode, Q3_mode, BSA, HT, PROT, UREE, WT)
ggpairs(Test_cov_cl_V1_V2, title = "Correlogram between the individuals parameters and covariates" ) + theme_minimal()En ne prenant en compte que les corrélations possédant un r2 > | 0.5 |, nous pouvons voir qu’il existe 2 possibles covariables à ajouter au modèle, la valeur d’urée correlé à la clairance (Cl) et la surface corporelle (BSA) correlé au Volume central (V1). Testons l’ajout de ces covariables :
## ajout Cov
LL_3cp_Cl_urea$Compartment<-"3 cp_CL-urea"
LL_3cp_Cl_urea_V1_BSA<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/3 cp/Training Cl-urée, V1-BSA/LogLikelihood/logLikelihood.txt", header = T, sep = ",")
LL_3cp_Cl_urea_V1_BSA$Compartment<-"3 cp_CL-urea_V1-BSA"
LL_comparison_cp_cov<-bind_rows(LL_3cp, LL_3cp_Cl_urea, LL_3cp_Cl_urea_V1_BSA)
LL_comparison_cp_cov<-pivot_wider(LL_comparison_cp_cov, names_from= Compartment, values_from = importanceSampling)
datatable(LL_comparison_cp_cov,
extensions = 'Buttons',
options = list(dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel')))Lorsque nous ajoutons l’urée à la clairance, nous observons une diminution significative de l’AIC par rapport au modèle sans covariable. En revanche lorsque l’on ajoute le BSA, l’AIC augmente ce qui montre que cette covariable n’est pas pertinente dans l’estimation des paramètres.
predictions_training_cov<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/3 cp/Training Cl-Urée/predictions.txt", header = T, sep = ",")
EstimatedIndividualParameters_training_cov<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/3 cp/Training Cl-Urée/IndividualParameters/estimatedIndividualParameters.txt", header = T, sep = ",")
reg_uree<-lm(DV~indivPred_mode, data = predictions_training_cov )
reg_pop_uree<-lm(DV~popPred, data = predictions_training_cov)
IPREDvsOBS_cov<-ggplot(predictions_training_cov) +
aes(x = DV, y = indivPred_mode) +
geom_point(size = 1L, colour = "#000000") +
stat_smooth(method="lm", se=F, ) +
labs(title = paste("Adj R2 = ",signif(summary(reg)$adj.r.squared, 5))) +
theme_minimal()
PREDvsOBS_cov<-ggplot(predictions_training_cov) +
aes(x = DV, y = popPred) +
geom_point(size = 1L, colour = "#000000") +
theme_minimal() +
stat_smooth(method="lm", se=F, ) +
labs(title = paste("Adj R2 = ",signif(summary(reg_pop_uree)$adj.r.squared, 5)))
IndWResvsOBS_cov<-ggplot(predictions_training_cov) +
aes(x = DV, y = indWRes_mode) +
geom_point(size = 1L, colour = "#000000") +
geom_hline(yintercept = 0) +
theme_minimal()
IndWResvsTime_cov<-ggplot(predictions_training_cov) +
aes(x = time, y = indWRes_mode) +
geom_point(size = 1L, colour = "#000000") +
geom_hline(yintercept = 0) +
theme_minimal()
IPREDvsOBS_cov## chargement données NCA
NCA<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/NCA/IndividualParameters/ncaIndividualParameters.txt", header = T, sep = ",")
EstimatedIndividualParameters_testing_cov<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/3 cp/Test uree/IndividualParameters/estimatedIndividualParameters.txt", header = T, sep = ",")
EstimatedIndividualParameters_Lss_cov<-read.table("/Users/alexandredestere/Desktop/Iohexol JBW/3 cp/Test 0.1, 1, 9 uree/IndividualParameters/estimatedIndividualParameters.txt", header = T, sep = ",")
NCA<-NCA%>% slice(-1)
NCA$Cl_obs<-as.numeric(NCA$Cl_obs)
NCA$Cl_pred<-as.numeric(NCA$Cl_pred)
RMSE_3cp<-signif(rmse(NCA$Cl_obs, EstimatedIndividualParameters_testing$Cl_mode), 3)
RMSE_3cp_cov<-signif(rmse(NCA$Cl_obs, EstimatedIndividualParameters_testing_cov$Cl_mode), 3)
RMSE_lss<-signif(rmse(NCA$Cl_obs, EstimatedIndividualParameters_Lss$Cl_mode), 3)
RMSE_lss_cov<-signif(rmse(NCA$Cl_obs, EstimatedIndividualParameters_Lss_cov$Cl_mode), 3)
Bias_3cp<-signif(mean((NCA$Cl_obs-EstimatedIndividualParameters_testing$Cl_mode)/NCA$Cl_obs), 3)
Bias_3cp_cov<-signif(mean((NCA$Cl_obs-EstimatedIndividualParameters_testing_cov$Cl_mode)/NCA$Cl_obs), 3)
Bias_lss<-signif(mean((NCA$Cl_obs-EstimatedIndividualParameters_Lss$Cl_mode)/NCA$Cl_obs), 3)
Bias_lss_cov<-signif(mean((NCA$Cl_obs-EstimatedIndividualParameters_Lss_cov$Cl_mode)/NCA$Cl_obs), 3)
comp<-data.frame(RMSE_3cp, Bias_3cp, RMSE_3cp_cov, Bias_3cp_cov, RMSE_lss, Bias_lss, RMSE_lss_cov, Bias_lss_cov)
comp_longer<- pivot_longer(comp,c(`RMSE_3cp`, `Bias_3cp`, `RMSE_3cp_cov`, `Bias_3cp_cov`, `RMSE_lss`,`Bias_lss`, `RMSE_lss_cov`, `Bias_lss_cov`))
datatable(comp_longer, class = "compact",
extensions = 'Buttons',
options = list(dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel')))