I'm trying to implement the logit/probit model derivation as introduced by Finney using sample data from http://dge.stanford.edu/SCOPE/SCOPE_12/SCOPE_12.html, chapter 6 (this links to a pdf), page 130, table 6.3. Results are similar but not identical. Finney calculated LD50 = 4.85.
Here is the source code and output of my R program:
# Finney, 1952
dosis <- c(2.6,3.8,5.1,7.7,10.2)
nges <- c(50,48,46,49,50)
nok <- c(6,16,24,42,44)
edx <- function(dosis=NA, nges=NA, nok=NA, lk='logit') {
require(MASS)
# weights w according to Finney 1952:
p <- nok/nges
q <- 1-p
w <- nges*p*q
# logit/probit model
edx.data <- data.frame(dosis, nges, nok)
glm.logit <- glm(cbind(nok,nges-nok) ~ dosis, family=binomial(lk), data=edx.data, weights=w)
# Calculation of EDx data
r <- dose.p(glm.logit,p=seq(0.1,0.9,0.2))
# Statistical summary
d <- data.frame(x=c(NA,NA,NA,NA))
rownames(d) <- c('Deg. of freedom','Deviance','1-chi.square','Significant difference between fits and observations')
d$x[1] <- df.residual(glm.logit)
d$x[2] <- deviance(glm.logit)
d$x[3] <- 1-pchisq(d$x[2],d$x[1])
d$x[4] <- ifelse(d$x[3]>0.05,'No','Yes')
# Printing of data tables
print(edx.data)
writeLines('')
print(r)
writeLines('')
print(d)
return(glm.logit)
}
g <- edx(dosis=dosis, nges=nges, nok=nok, lk='logit')
The numerical output is as follows:
dosis nges nok
1 2.6 50 6
2 3.8 48 16
3 5.1 46 24
4 7.7 49 42
5 10.2 50 44
Dose SE
p = 0.1: 1.171955 0.22512512
p = 0.3: 3.615213 0.12064635
p = 0.5: 5.148754 0.09792762
p = 0.7: 6.682294 0.13521132
p = 0.9: 9.125553 0.24565236
x
Deg. of freedom 3
Deviance 33.3237083095658
1-chi.square 2.75205023214653e-07
Significant difference between fits and observations Yes
Thus, LD50 would be 5.149 according to this R program (vs. 4.85 as calculated by Finney). What is wrong here?
Thank you very much for any help!
p <- nok/nges; logit.p <- log(p/(1-p)); lm(logit.p~log(dosis))
. The linear regression gives the coefficients $\hat{a}=-4.834$ and $\hat{b}=3.061$, respectively, so that $\hat{x}_{50}=4.834/3.061\approx 1.579$. Lastly, $\widehat{\mathrm{LD}}_{50}=\exp{(1.579)}\approx 4.85$ as given in the book. $\endgroup$