Learn R Programming

breathtestcore (version 0.8.7)

coef.breathtestfit: S3 coef and summary for breathtestfit

Description

Function coef extracts the estimates such as t50, tlag, from fitted 13C beta exponential models. The result is the same as fit$coef, but without column stat, which always is "estimate" for nls_fit and nlme_fit.

The summary method only extracts t50 by the Maes/Ghoos method

Usage

# S3 method for breathtestfit
coef(object, ...)

Arguments

object

of class breathtestfit, as returned by nls_fit or nlme_fit

...

other parameters passed to methods

Examples

Run this code
# Generate simulated data
data = cleanup_data(simulate_breathtest_data())
# Fit with the population method
fit = nlme_fit(data)
# All coefficients in the long form
coef(fit)
# Access coefficients directly
fit$coef
# Only t50 by Maes/Ghoos
# Can also be used with stan fit (slow!)
if (FALSE) {
if (require("breathteststan")) {
  fit = stan_fit(data, iter = 300, chain = 1)
  coef(fit)
  # We get quantiles here in key/value format
  unique(fit$coef$stat)
}
}

Run the code above in your browser using DataLab