Plot a fitted nonlinear mixed model obtained via an mmkin row object

# S3 method for nlme.mmkin
plot(
  x,
  i = 1:ncol(x$mmkin_orig),
  main = "auto",
  legends = 1,
  resplot = c("time", "errmod"),
  standardized = FALSE,
  show_errmin = TRUE,
  errmin_var = "All data",
  errmin_digits = 3,
  cex = 0.7,
  rel.height.middle = 0.9,
  ymax = "auto",
  ...
)

Arguments

x

An object of class nlme.mmkin

i

A numeric index to select datasets for which to plot the nlme fit, in case plots get too large

main

The main title placed on the outer margin of the plot.

legends

An index for the fits for which legends should be shown.

resplot

Should the residuals plotted against time, using mkinresplot, or as squared residuals against predicted values, with the error model, using mkinerrplot.

standardized

Should the residuals be standardized? This option is passed to mkinresplot, it only takes effect if resplot = "time".

show_errmin

Should the chi2 error level be shown on top of the plots to the left?

errmin_var

The variable for which the FOCUS chi2 error value should be shown.

errmin_digits

The number of significant digits for rounding the FOCUS chi2 error percentage.

cex

Passed to the plot functions and mtext.

rel.height.middle

The relative height of the middle plot, if more than two rows of plots are shown.

ymax

Maximum y axis value for plot.mkinfit.

...

Further arguments passed to plot.mkinfit and mkinresplot.

Value

The function is called for its side effect.

Author

Johannes Ranke

Examples

ds <- lapply(experimental_data_for_UBA_2019[6:10], function(x) subset(x$data[c("name", "time", "value")], name == "parent")) f <- mmkin("SFO", ds, quiet = TRUE, cores = 1)
#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.0195
#> Warning: Shapiro-Wilk test for standardized residuals: p = 0.011
#plot(f) # too many panels for pkgdown plot(f[, 3:4])
library(nlme) f_nlme <- nlme(f) #plot(f_nlme) # too many panels for pkgdown plot(f_nlme, 3:4)