Learn R Programming

PopED (version 0.1.1)

plot_model_prediction: Plot model predictions

Description

Function plots model predictions for the typical value in the population, individual predictions and data predictions.

Usage

plot_model_prediction(poped.db, model_num_points = 100, separate.groups = F,
  sample.times = T, sample.times.IPRED = F, sample.times.DV = F,
  PRED = T, IPRED = F, IPRED.lines = F, alpha.IPRED.lines = 0.1,
  alpha.IPRED = 0.3, sample.times.size = 4, DV = F, alpha.DV = 0.3,
  DV.lines = F, DV.points = F, alpha.DV.lines = 0.3,
  alpha.DV.points = 0.3, sample.times.DV.points = F,
  sample.times.DV.lines = F, alpha.sample.times.DV.points = 0.3,
  alpha.sample.times.DV.lines = 0.3, y_lab = "Model Predictions",
  facet_scales = "fixed", facet_label_names = T, ...)

Arguments

separate.groups
Should there be separate plots for each group.
sample.times
Should sample times be shown on the plots.
sample.times.IPRED
Should sample times be shown based on the IPRED y-values.
sample.times.DV
Should sample times be shown based on the DV y-values.
PRED
Should a PRED line be drawn.
IPRED.lines
Should IPRED lines be drawn?
alpha.IPRED.lines
What should the transparency for the IPRED.lines be?
alpha.IPRED
What should the tranparency of the IPRED CI?
sample.times.size
What should the size of the sample.times be?
alpha.DV
What should the tranparency of the DV CI?
DV.lines
Should DV lines be drawn?
DV.points
Should DV points be drawn?
alpha.DV.lines
What should the transparency for the DV.lines be?
alpha.DV.points
What should the transparency for the DV.points be?
sample.times.DV.points
TRUE or FALSE.
sample.times.DV.lines
TRUE or FALSE.
alpha.sample.times.DV.points
What should the transparency for the sample.times.DV.points be?
alpha.sample.times.DV.lines
What should the transparency for the sample.times.DV.lines be?
y_lab
The label of the y-axis.
facet_scales
Can be "free", "fixed", "free_x" or "free_y"
facet_label_names
TRUE or FALSE
poped.db
A PopED database.
...
arguments passed to evaluate.fim and ofv_fim.
model_num_points
How many points should be plotted. If not a number then the design in poped.db is used.
IPRED
Should we simulate individual predictions?
DV
should we simulate observations?

Value

See Also

Other Graphics: plot_efficiency_of_windows

Other Simulation: model_prediction; plot_efficiency_of_windows

Other evaluate_design: evaluate.fim; get_rse; model_prediction; plot_efficiency_of_windows

Examples

Run this code
## Warfarin example from software comparison in:
## Nyberg et al., "Methods and software tools for design evaluation 
##   for population pharmacokinetics-pharmacodynamics studies", 
##   Br. J. Clin. Pharm., 2014. 

library(PopED)

## find the parameters that are needed to define from the structural model
ff.PK.1.comp.oral.md.CL

## -- parameter definition function 
## -- names match parameters in function ff
sfg <- function(x,a,bpop,b,bocc){
  parameters=c(CL=bpop[1]*exp(b[1]),
               V=bpop[2]*exp(b[2]),
               KA=bpop[3]*exp(b[3]),
               Favail=bpop[4],
               DOSE=a[1])
    return(parameters) 
}

## -- Define initial design  and design space
poped.db <- create.poped.database(ff_file="ff.PK.1.comp.oral.sd.CL",
                                  fg_file="sfg",
                                  fError_file="feps.prop",
                                  bpop=c(CL=0.15, V=8, KA=1.0, Favail=1), 
                                  notfixed_bpop=c(1,1,1,0),
                                  d=c(CL=0.07, V=0.02, KA=0.6), 
                                  sigma=0.01,
                                  groupsize=32,
                                  xt=c( 0.5,1,2,6,24,36,72,120),
                                  minxt=0,
                                  maxxt=120,
                                  a=70)

##  create plot of model without variability 
plot_model_prediction(poped.db)

##  create plot of model with variability 
plot_model_prediction(poped.db,IPRED=TRUE,DV=TRUE)

Run the code above in your browser using DataLab