ecoffinder_nls: Find Cutoff Value by Nonlinear Regression to Truncated Data

Description Usage Arguments Details Value References See Also Examples

View source: R/ecoffinder_nls.R

Description

Identifies the wild-type sub-population by fitting a cumulative normal distribution to subsets of MIC or ID data.

Usage

1
2
3
4
5
6
7
8
ecoffinder_nls(
  conc,
  count,
  startpar = "mode",
  concentrations = NA,
  log2 = TRUE,
  plot = TRUE
)

Arguments

conc

concentration of the antibiotic

count

raw frequency

startpar

start parameters for the nonlinear search, or "mode" resp. "mean" for an automatic determination

concentrations

which concentrations are tested

log2

logical determining if conc are log-transformed or not

plot

logical, switch visualization on or off

Details

Start values for the nonlinear regression can be automatically determined with function ecoffinder_startpar.

The default search interval starts one concentration level above the mode resp. mean.

Value

an object of class abr_ecoffinder-class containing the fitted parameters and statistics of the final and intermediate fits.

References

Turnidge, J., Kahlmeter, G., Kronvall, G. (2006) Statistical characterization of bacterial wild-type MIC value distributions and the determination of epidemiological cut-off values. Clin Microbial Infect 12: 418-425 doi: 10.1111/j.1469-0691.2006.01377.x

See Also

ecoffinder_startpar for heuristic methods to guess start parameters
ECOFFinder for an interactice shiny app

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## raw data contain NA values
data(micdata)
plot(freq ~ log2(conc), data=micdata, type="h")

## discard NA values
measured <- na.omit(micdata)

## cumulative plot
plot(cumsum(freq) ~ log2(conc), data=measured, type="l")

x <- log2(measured$conc)
y <- measured$freq

## heuristic start values
pstart <- ecoffinder_startpar(x, y)
pstart

## nonlinear regression
p <- ecoffinder_nls(x, y, pstart)
summary(p)

tpetzoldt/antibioticR documentation built on Sept. 25, 2021, 1:17 p.m.