EC_table: Function to generate a table of EC values from a data frame...

Description Usage Arguments Value Author(s) Examples

Description

Function to generate a table of EC values from a data frame of multiple isolates.

Usage

1
2
EC_table(x, form = NULL, model = "LL.3", response = c(10, 50, 90),
  idcol = "ID", result = "df", plot = TRUE, ...)

Arguments

x

a data frame that has at least the columns listed in the form argument (e.g. "response" and "dose", see examples).

form

a formula specifying the column names for the response and dose. Defaults to NULL.

model

one of 4 options:

  • LL.3 = Log Logistic 3 parameter with a lower limit of 0.

  • LL.4 = Log Logistic 4 parameter with lower limit estimated.

  • W1.4 = Weibul 4 parameter type 1.

  • W2.4 = Weibul 4 parameter type 2.

response

a numeric vector specifying what EC values you want to calculate.

idcol

the name of the column that identifies the samples (case sensitive).

result

What result do you want returned? Default is "df" for a data frame of summary values. If you want the models returned, choose "model". If you want the summary output of the model, choose "summary".

plot

if TRUE, a curve will be plotted for each sample.

...

parameters passed on to read.table if x is a file name.

Value

a data frame that contains EC estimates and standard errors in columns and samples in rows.

Author(s)

Zhian N. Kamvar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(dummydata)
# Using 3 parameter Log-Logistic Model (default)
EC_table(dummydata, form = response ~ dose)

# Using 4 parameter Weibull Model.
EC_table(dummydata, form = response ~ dose, model = "W2.4")

# This function really only needs three columns.
newdat <- dummydata[c("ID", "dose", "response")]
EC_table(newdat, form = response ~ dose)

# We can rename them, too.
colnames(newdat) <- c("identity", "dosage", "growth")
EC_table(newdat, form = growth ~ dosage, idcol = "identity")

Example output

# A tibble: 2 x 7
  sample  Estimate.10    SE.10 Estimate.50  SE.50 Estimate.90 SE.90
  <chr>         <dbl>    <dbl>       <dbl>  <dbl>       <dbl> <dbl>
1 Sample1    0.000954 0.00118       0.0829 0.0410        7.20  5.06
2 Sample2    0.000660 0.000875      0.0924 0.0471       12.9   9.77
# A tibble: 2 x 7
  sample  Estimate.10   SE.10 Estimate.50  SE.50 Estimate.90 SE.90
  <chr>         <dbl>   <dbl>       <dbl>  <dbl>       <dbl> <dbl>
1 Sample1     0.00400 0.00401      0.0868 0.0413        10.9  14.6
2 Sample2     0.00236 0.00314      0.104  0.0564        39.2  83.9
# A tibble: 2 x 7
  sample  Estimate.10    SE.10 Estimate.50  SE.50 Estimate.90 SE.90
  <chr>         <dbl>    <dbl>       <dbl>  <dbl>       <dbl> <dbl>
1 Sample1    0.000954 0.00118       0.0829 0.0410        7.20  5.06
2 Sample2    0.000660 0.000875      0.0924 0.0471       12.9   9.77
# A tibble: 2 x 7
  sample  Estimate.10    SE.10 Estimate.50  SE.50 Estimate.90 SE.90
  <chr>         <dbl>    <dbl>       <dbl>  <dbl>       <dbl> <dbl>
1 Sample1    0.000954 0.00118       0.0829 0.0410        7.20  5.06
2 Sample2    0.000660 0.000875      0.0924 0.0471       12.9   9.77

ezec documentation built on May 2, 2019, 8:08 a.m.