summary.nlme.mmkin: Summary method for class "nlme.mmkin"

View source: R/summary.nlme.mmkin.R

summary.nlme.mmkinR Documentation

Summary method for class "nlme.mmkin"

Description

Lists model equations, initial parameter values, optimised parameters for fixed effects (population), random effects (deviations from the population mean) and residual error model, as well as the resulting endpoints such as formation fractions and DT50 values. Optionally (default is FALSE), the data are listed in full.

Usage

## S3 method for class 'nlme.mmkin'
summary(
  object,
  data = FALSE,
  verbose = FALSE,
  distimes = TRUE,
  alpha = 0.05,
  ...
)

## S3 method for class 'summary.nlme.mmkin'
print(x, digits = max(3, getOption("digits") - 3), verbose = x$verbose, ...)

Arguments

object

an object of class nlme.mmkin

data

logical, indicating whether the full data should be included in the summary.

verbose

Should the summary be verbose?

distimes

logical, indicating whether DT50 and DT90 values should be included.

alpha

error level for confidence interval estimation from the t distribution

...

optional arguments passed to methods like print.

x

an object of class summary.nlme.mmkin

digits

Number of digits to use for printing

Value

The summary function returns a list based on the nlme object obtained in the fit, with at least the following additional components

nlmeversion, mkinversion, Rversion

The nlme, mkin and R versions used

date.fit, date.summary

The dates where the fit and the summary were produced

diffs

The differential equations used in the degradation model

use_of_ff

Was maximum or minimum use made of formation fractions

data

The data

confint_trans

Transformed parameters as used in the optimisation, with confidence intervals

confint_back

Backtransformed parameters, with confidence intervals if available

ff

The estimated formation fractions derived from the fitted model.

distimes

The DT50 and DT90 values for each observed variable.

SFORB

If applicable, eigenvalues of SFORB components of the model.

The print method is called for its side effect, i.e. printing the summary.

Author(s)

Johannes Ranke for the mkin specific parts José Pinheiro and Douglas Bates for the components inherited from nlme

Examples


# Generate five datasets following SFO kinetics
sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
dt50_sfo_in_pop <- 50
k_in_pop <- log(2) / dt50_sfo_in_pop
set.seed(1234)
k_in <- rlnorm(5, log(k_in_pop), 0.5)
SFO <- mkinmod(parent = mkinsub("SFO"))

pred_sfo <- function(k) {
  mkinpredict(SFO,
    c(k_parent = k),
    c(parent = 100),
    sampling_times)
}

ds_sfo_mean <- lapply(k_in, pred_sfo)
names(ds_sfo_mean) <- paste("ds", 1:5)

set.seed(12345)
ds_sfo_syn <- lapply(ds_sfo_mean, function(ds) {
  add_err(ds,
    sdfunc = function(value) sqrt(1^2 + value^2 * 0.07^2),
    n = 1)[[1]]
})

## Not run: 
# Evaluate using mmkin and nlme
library(nlme)
f_mmkin <- mmkin("SFO", ds_sfo_syn, quiet = TRUE, error_model = "tc", cores = 1)
f_nlme <- nlme(f_mmkin)
summary(f_nlme, data = TRUE)

## End(Not run)


jranke/mkin documentation built on April 29, 2024, 7:33 a.m.