simdata: Simulate dose-response data.

Description Usage Arguments Value Author(s) Examples

Description

Simulates a simple data set.

Usage

1
simdata(nchem, nassay, seed = NULL)

Arguments

nchem

Number of chemicals.

nassay

Number of assays.

seed

Random seed.

Value

dat

A data set of read to use in the ZIPLL function with chemical ID, assay ID, concentration, and response.

Author(s)

Ander Wilson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#simulate data
dat <- simdata(nchem=10, nassay=4, seed=1234)

#fit ZIPLL
fit <- ZIPLL(dat)

#plot a curve
dose<-fit$dat[,3]
response<-fit$dat[,4]
post.mn<-fit$dat[,5]
post.sd<-fit$dat[,6]

these<-dat[,1]==6 & dat[,2]==2
plot(dose[these],response[these],xlab="Log dose",ylab="Response", log="x")
lines(dose[these],post.mn[these])
lines(dose[these],post.mn[these]-2*post.sd[these],lty=2)
lines(dose[these],post.mn[these]+2*post.sd[these],lty=2)

AnderWilson/ZIPLL documentation built on May 5, 2019, 4:56 a.m.