Usage

1
2

Arguments

data

Data frame or tibble as created by cleanup_data,
with mandatory columns patient_id, group, minute and pdr.
It is recommended to run all data through cleanup_data which
will insert dummy columns for patient_id and minute if the
data are distinct, and report an error if not. Since the Bayesian method
is stabilized by priors, it is possible to fit single curves.

dose

Dose of acetate or octanoate. Currently, only one common dose
for all records is supported.

sample_minutes

If mean sampling interval is < sampleMinutes, data are subsampled
using a spline algorithm

student_t_df

When student_t_df < 10, the student distribution is used to
model the residuals. Recommended values to model typical outliers are from 3 to 6.
When student_t_df >= 10, the normal distribution is used.

chains

Number of chains for Stan

iter

Number of iterations for each Stan chain

model

Name of model; use names(stanmodels) for other models.

Value

A list of classes "breathteststanfit" and "breathtestfit" with elements

coef Estimated parameters as data frame in a key-value format with
columns patient_id, group, parameter, method and value.
Has an attribute AIC.

data The effectively analyzed data. If density of points
is too high, e.g. with BreathId devices, data are subsampled before fitting.

stan_fit The Stan fit for use with shinystan::launch_shiny
or extraction of chains.