Do visual predictive check (VPC) plots for nlme-based non-linear mixed effect models

vpc_nlmixr_nlme(fit, nsim = 100, condition = NULL, ...)

vpcNlmixrNlme(fit, nsim = 100, condition = NULL, ...)

# S3 method for nlmixrNlme
vpc(sim, ...)

Arguments

fit

nlme fit object

nsim

number of simulations

condition

conditional variable

...

Additional arguments

sim

this is usually a data.frame with observed data, containing the independent and dependent variable, a column indicating the individual, and possibly covariates. E.g. load in from NONMEM using read_table_nm. However it can also be an object like a nlmixr or xpose object

Value

Called for its side effects of creating a VPC

Examples

specs <- list(fixed=lKA+lCL+lV~1, random = pdDiag(lKA+lCL~1), start=c(lKA=0.5, lCL=-3.2, lV=-1))
fit <- nlme_lin_cmpt(theo_md, par_model=specs, ncmt=1, verbose=TRUE)
#> 
#> **Iteration 1
#> LME step: Loglik: -420.4062, nlminb iterations: 1
#> reStruct  parameters:
#>      ID1      ID2 
#> 5.434250 5.693011 
#>  Beginning PNLS step: ..  completed fit_nlme() step.
#> PNLS step: RSS =  300.8155 
#>  fixed effects: 0.2384012  1.057595  3.395177  
#>  iterations: 7 
#> Convergence crit. (must all become <= tolerance = 1e-05):
#>    fixed reStruct 
#> 4.025732 4.507369 
#> 
#> **Iteration 2
#> LME step: Loglik: -422.6508, nlminb iterations: 5
#> reStruct  parameters:
#>       ID1       ID2 
#> 0.9829978 1.4302117 
#>  Beginning PNLS step: ..  completed fit_nlme() step.
#> PNLS step: RSS =  300.5795 
#>  fixed effects: 0.2352729  1.058965  3.393164  
#>  iterations: 3 
#> Convergence crit. (must all become <= tolerance = 1e-05):
#>       fixed    reStruct 
#> 0.013296459 0.004640789 
#> 
#> **Iteration 3
#> LME step: Loglik: -422.666, nlminb iterations: 1
#> reStruct  parameters:
#>       ID1       ID2 
#> 0.9821654 1.4298669 
#>  Beginning PNLS step: ..  completed fit_nlme() step.
#> PNLS step: RSS =  300.5795 
#>  fixed effects: 0.2352729  1.058965  3.393164  
#>  iterations: 1 
#> Convergence crit. (must all become <= tolerance = 1e-05):
#>    fixed reStruct 
#>        0        0 
vpc_nlmixr_nlme(fit, nsim = 100, condition = NULL)