[R] dose-response on a grid

2007-07-12 Thread William Simpson
I have the following problem. I have measured a dose response curve
(binary response, continuous dose) on a grid of x,y positions. I would
like to produce a grey-level plot that shows the LD50 at each (x,y)
position.

I am thinking that I have to do something like
fit-glm(resp ~ x*y + dose, family = binomial)
Corrections welcome.

But from here I don't know how to get LD50, and certainly not at each
x,y, position.

Thanks very much for any help.

Bill

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] dose-response on a grid

2007-07-12 Thread Christian Ritz
Hi Bill,

have a look at the following artificial example:

## Loading the package 'drc' (on CRAN)
library(drc)

## Generating dataset with four dose-response curves
finneyx4 - rbind(finney71, finney71, finney71, finney71)

## Generating artificial points (x,y)
## different pairs for each of the 4 curves in the above dataset
finneyx4$x - rep(1, 24)
finneyx4$y - rep(1:4, c(6, 6, 6, 6))

## Fitting the two-parameter log-logistic model (logistic regression)
m1 - drm(affected/total ~ dose, as.factor(x):as.factor(y), weights = total,
data = finneyx4, fct = LL.2(), type = binomial)

## Calculating ED50/LD50 for each location (they are all the same for this 
dataset)
ED(m1, 50)


You could try the same approach for your data!


Christian

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.