I am trying to calculate LC50 from a list of bootstrapped GLM output
I have the output of bootstrapped GLM in a list (named results) as such:
(I have just put in the last result for ease rather than the whole list)
$thetastar[[100]]
Call: glm(formula = dead[x] ~ concentration[x] + factor(female.no[x]),
family = binomial, data = subset.data.48hr)
Coefficients:
(Intercept) concentration[x] factor(female.no[x])3 factor(female.no[x])4 factor(female.no[x])7
0.7386 0.1869 -0.8394 -5.6613 -2.9576
factor(female.no[x])8 factor(female.no[x])9
-1.5329 -2.7826
Degrees of Freedom: 354 Total (i.e. Null); 348 Residual
(1265 observations deleted due to missingness)
Null Deviance: 484.2
Residual Deviance: 257 AIC: 271
using dose.p
from the MASS
package I am trying to calculate the LC50 for each individual within the model which has run
dose.p(results$thetastar[[100]], cf = c(2,3), p = 0.5)
which returns
Dose SE
p = 0.5: 0.2227249 0.161769
From what I understand this is the LC50 for factor(female.no[x])3.
i.e. into dose.p
I have put cf = c(2,3)
which i take to be column 2 and column 3, the concentration
and the factor(female.no[x])3.
Is this correct?
secondly:
Is there a way I can get LC50 for each of the females, i.e. factor(female.no[x])3
, factor(female.no[x])4
, factor(female.no[x])7
and so on, I don't see how i can get dose.p
work work along the differing variables without manually changing the code cf=
:
dose.p(results$thetastar[[100]], cf = c(2,3), p = 0.5)
dose.p(results$thetastar[[100]], cf = c(2,4), p = 0.5)
dose.p(results$thetastar[[100]], cf = c(2,4), p = 0.5)
finally:
My results are stored in a list, How do i get dose.p
to work along the list, would it be something like:
test=matrix
for(i in 1:results){
test[i,]= dose.p(results$thetastar[[i]], cf = c(2,3), p = 0.5)
Thanks for any help