I'm implementing the McKelvey & Zavoina pseudo-R2 measure for use with the drc package and intend to open-source the solution and contribute to that project.
I can do standard R2 with
R2 <- 1-(modelFit(fit)$RSS[2]/sum((fit$data$response-mean(fit$data$response))^2))
but obviously that's not appropriate for logistic regression.
This is the code I'm using at the moment.
Some setup:
library(drc)
standards<-structure(list(dose = c(12.698970004336, 12.698970004336, 12.397940008672,
12.397940008672, 12.0969100130081, 12.0969100130081, 11.7958800173441,
11.7958800173441, 11.4948500216801, 11.4948500216801, 11.1938200260161,
11.1938200260161, 10.8927900303521, 10.8927900303521, 10.5917600346881,
10.5917600346881), response = c(0.196, 0.201, 0.297, 0.293, 0.534, 0.529, 0.854,
1.079, 1.523, 1.534, 1.619, 1.529, 1.723, 1.734, 1.819, 1.829)),
.Names = c("dose", "response"), row.names = c(NA, -16L), class = "data.frame")
fit<-drm(response~dose, data=standards,fct=LL.4())
Then the McKelvey & Zavoina R2 algorithm:
MZystar <- predict(fit)
sse <- sum((MZystar - mean(MZystar))^2)
s2 <- pi^2/3
R2MZ <- sse/(s2 + sse)
But the values it's producing don't seem right.