Visualizing lmer and limits [Study Assessment]
❝ ❝ Blue dot-dashed lines: 90% limits built using 90% CIs for the slope and intercept
❝ ❝ Red lines: 80-125% acceptance limits
❝ I must confess that I don't understand what you do here with the last two points.

❝ Dose dependent 90% limits for what using 90% CIs for the slope and intercept
For now I don't think that's correct, since the final conclusion should be made using slope only. So I removed intercept uncertainty from calculation of 90% CI prediction line.
As Dr.Smith mentioned, 'The estimate of the “intercept” parameter ... with a 90% CI of ... and its between-subject variability are not of interest here'
❝ Dose dependent acceptance limits .
❝ Could you please elaborate and enlighten me?
❝ With simple words please, not with complex sophisticated code.
If Beta1 should be less than 1 + ln(Theta2)/ln(r), then what is the PK level in the current dose point which is still acceptable?
From my graph one could see that Dose = 50 is the last acceptable point.
❝ The prediction area is calculated based on the dose values used in the study. Should it not calculated on interpolated dose values to get more smooth area borders?
❝ And why do you used the prediction interval as a fit visualization? AFAIK is prediction for future observations, but I think we had the goal to visualize the fit of our current observations. So would it not better to use a 90% confidence interval instead?
library(lme4)
library(lmerTest)
library(dplyr)
library(ggplot2)
lowBind <- 0.8
Subj <- c(1, 2, 4, 5, 6, 4, 5, 6, 7, 8, 9, 7, 8, 9)
Dose <- c(25, 25, 50, 50, 50, 250, 250, 250, 75, 75, 75, 250, 250, 250)
Cmax <- c(64.82, 67.35, 104.15, 143.12, 243.63, 451.44, 393.45,
796.57, 145.13, 166.77, 296.90, 313.00, 387.00, 843.00)
resp <- data.frame(Subj, Dose, Cmax)
resp$Subj <- factor(resp$Subj)
muddle <- lmer(log(Cmax) ~ log(Dose) + (1|Subj), data=resp, REML = FALSE)
coefs <- data.frame(summary(muddle)$coefficients)
DoseSequence <- data.frame(DoseSequence = seq(sort(unique(Dose))[1], max(Dose), length.out = 100))
LinesDF <-
DoseSequence %>%
mutate(Fit = exp(coefs['(Intercept)','Estimate'] + log(DoseSequence) * coefs['log(Dose)','Estimate']),
LowCI = exp(coefs['(Intercept)','Estimate'] + log(DoseSequence) * (coefs['log(Dose)', 'Estimate'] - qt(1-0.05, coefs['log(Dose)', 'df']) * coefs['log(Dose)', 'Std..Error'])),
UpCI = exp(coefs['(Intercept)','Estimate'] + log(DoseSequence) * (coefs['log(Dose)', 'Estimate'] + qt(1-0.05, coefs['log(Dose)', 'df']) * coefs['log(Dose)', 'Std..Error'])),
LowLi = exp(coefs['(Intercept)','Estimate'] + log(DoseSequence) * (1+log(lowBind)/log(DoseSequence/min(Dose)))),
UpLi = exp(coefs['(Intercept)','Estimate'] + log(DoseSequence) * (1-log(lowBind)/log(DoseSequence/min(Dose))))
)
ggplot() +
geom_point(data = resp,aes(x = Dose, y = Cmax), size = 3, fill = 'black')+
geom_line(data = LinesDF, aes(x = DoseSequenceFirst, y = Fit), size = 2, color = 'blue', linetype = 'dashed') +
geom_line(data = LinesDF, aes(x = DoseSequenceFirst, y = LowCI), size = 2, color = 'blue', linetype = 'dotdash' ) +
geom_line(data = LinesDF, aes(x = DoseSequenceFirst, y = UpCI), size = 2, color = 'blue', linetype = 'dotdash' ) +
geom_line(data = LinesDF%>%filter(DoseSequence >= sort(unique(Dose))[2]), aes(x = DoseSequence, y = LowLi), size = 2, color = 'red') +
geom_line(data = LinesDF%>%filter(DoseSequence >= sort(unique(Dose))[2]), aes(x = DoseSequence, y = UpLi), size = 2, color = 'red') +
scale_y_continuous(trans = 'log10') +
theme_bw()
![[image]](img/uploaded/image210.jpg)
Kind regards,
Mittyri
Complete thread:
- Dose Proportionality and Variance AngusMcLean 2016-05-11 16:55 [Study Assessment]
- More information, please Helmut 2016-05-12 14:34
- More information, please AngusMcLean 2016-05-13 16:40
- Setup in Phoenix/WinNonlin Helmut 2016-05-14 02:26
- Setup in Phoenix/WinNonlin AngusMcLean 2016-05-14 18:54
- Setup in Phoenix/WinNonlin Helmut 2016-05-15 14:47
- Setup in Phoenix/WinNonlin AngusMcLean 2016-05-15 15:17
- Phoenix 64 Warning Helmut 2016-05-15 15:56
- Phoenix 64 Warning AngusMcLean 2016-05-15 20:11
- OT: imperial vs. metric units Helmut 2016-05-16 16:26
- Phoenix 64 Warning AngusMcLean 2016-05-15 20:11
- Setup in Phoenix/WinNonlin ElMaestro 2016-05-15 20:54
- Setup in Phoenix/WinNonlin AngusMcLean 2016-05-15 22:30
- Phoenix 64 Warning Helmut 2016-05-15 15:56
- Setup in Phoenix/WinNonlin AngusMcLean 2016-05-15 15:17
- Setup in Phoenix/WinNonlin Helmut 2016-05-15 14:47
- Setup in Phoenix/WinNonlin AngusMcLean 2016-05-16 21:00
- NCSS vs. PHX/WNL vs. SAS Helmut 2016-05-17 01:50
- NCSS vs. PHX/WNL vs. SAS - Validation? mittyri 2016-05-18 08:23
- Diagnostics ElMaestro 2016-05-18 09:20
- Diagnostics: R and Phoenix Helmut 2016-05-18 15:14
- Diagnostics: R zizou 2016-05-22 19:07
- Diagnostics: R Helmut 2016-05-23 01:22
- SASian potpourri d_labes 2016-05-24 12:02
- Compilation Helmut 2016-05-24 14:27
- REML or not d_labes 2016-05-24 16:33
- complete or not Helmut 2016-05-24 16:57
- Compilation AngusMcLean 2016-05-26 16:46
- doubts about NCSS Helmut 2016-05-26 19:13
- Doubts about NCSS zizou 2016-05-26 23:38
- doubts about NCSS Helmut 2016-05-26 19:13
- Compilation AngusMcLean 2016-05-28 00:51
- Kenward-Roger? Helmut 2016-05-28 15:59
- 90% confidence interval for R_dnm Shuanghe 2019-01-04 17:45
- 90% confidence interval for R_dnm d_labes 2019-01-05 14:01
- Visualizing lmer and limits mittyri 2019-01-06 17:00
- Visualizing lmer and limits Shuanghe 2019-01-07 11:05
- Visualizing lmer and limits d_labes 2019-01-07 15:08
- Visualizing lmer and limitsmittyri 2019-01-13 23:53
- 90% confidence interval for R_dnm Shuanghe 2019-01-07 10:53
- 90% confidence interval for R_dnm d_labes 2019-01-07 15:17
- 90% confidence interval for R_dnm Shuanghe 2019-01-07 17:11
- 90% confidence interval for R_dnm d_labes 2019-01-07 18:24
- offtop: greek letters and tables mittyri 2019-01-08 00:19
- OT: greek letters and symbols Helmut 2019-02-02 16:04
- 90% confidence interval for R_dnm Shuanghe 2019-01-07 17:11
- 90% confidence interval for R_dnm d_labes 2019-01-07 15:17
- Visualizing lmer and limits mittyri 2019-01-06 17:00
- 90% confidence interval for R_dnm d_labes 2019-01-05 14:01
- REML or not d_labes 2016-05-24 16:33
- Compilation Helmut 2016-05-24 14:27
- SASian potpourri d_labes 2016-05-24 12:02
- Diagnostics: R Helmut 2016-05-23 01:22
- Diagnostics: R zizou 2016-05-22 19:07
- Diagnostics: R and Phoenix Helmut 2016-05-18 15:14
- Smith’s paper Helmut 2016-05-18 14:44
- Smith’s paper d_labes 2019-01-05 15:00
- Diagnostics ElMaestro 2016-05-18 09:20
- NCSS vs. PHX/WNL vs. SAS - Validation? mittyri 2016-05-18 08:23
- NCSS vs. PHX/WNL vs. SAS Helmut 2016-05-17 01:50
- Setup in Phoenix/WinNonlin AngusMcLean 2016-05-14 18:54
- Setup in Phoenix/WinNonlin Helmut 2016-05-14 02:26
- More information, please AngusMcLean 2016-05-13 16:40
- More information, please Helmut 2016-05-12 14:34