sim_dose_response: Simulate Dose Response Data

Description Usage Arguments Value Examples

View source: R/sim_dose_response.R

Description

Simulates dose response data for a cell line given a pIC50, upper and lower bounds, number of doses, number of replicates per dose and additive and proportional variance

Usage

1
2
sim_dose_response(pIC50 = 1, minconc = 0.001, maxconc = 30, ndoses = 10,
  nreps = 3, sd_prop = 0.1, sd_add = 0.1)

Arguments

pIC50

The pIC50 for the cell line

minconc

Lowest concentration the cell line is tested at

maxconc

Highest concentration the cell line is tested at

ndoses

Number of doses

nreps

Numer of replicates

sd_prop

Proportional standard deviation

sd_add

Additive standard deviation

Value

A data frame of dose response values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(ggplot2)
set.seed(10000)
#no error
ex1 <- sim_dose_response(1, 0.001, 30, 10, 3, 0, 0)
ex1
qplot(conc, resp, data=ex1) + scale_x_log10()

#some proportional error
ex2 <- sim_dose_response(1, 0.001, 30, 10, 3, 0.1, 0)
ex2
qplot(conc, resp, data=ex2) + scale_x_log10()

#some additive error
ex3 <- sim_dose_response(1, 0.001, 30, 10, 3, 0, 0.1)
ex3
qplot(conc, resp, data=ex3) + scale_x_log10()

#both error types
ex4 <- sim_dose_response(1, 0.001, 30, 10, 3, 0, 0.1)
ex4
qplot(conc, resp, data=ex3) + scale_x_log10()

chapmandu2/pgxsim documentation built on May 6, 2019, 10:13 a.m.