1

作为@EDi回答的这个问题的后续行动。我想知道如何将以下glm模型与包中的drc功能相匹配drc

GLM 代码

Type  <- rep(x=LETTERS[1:3], each=5, times=2)
Conc  <- rep(rep(x=seq(from=0, to=40, by=10), times=3), 2)
Rep   <- factor(rep(x=1:2, each=15))
Total <- 50
Kill  <- c(
            10, 30, 40, 45, 38, 5, 25, 35, 40, 32, 0, 32, 38, 47, 40,
            11, 33, 38, 43, 36, 4, 23, 34, 42, 34, 2, 35, 39, 46, 42
            )

df <- data.frame(Type, Conc, Rep, Total, Kill)

fm1 <- 
  glm(
    formula = Kill/Total~Rep+Type*Conc
    , family  = binomial(link="logit")
    , data    = df
    , weights = Total
  )

summary(fm1)
summary(fm1)$coef
anova(object=fm1, test="LRT")

drc 代码

library(drc)
fm2 <- drm(Kill/Total ~ Rep+Conc, 
           curveid = Type, 
           weights = Total, 
           data    = df, 
           fct     =  L.4(fixed = c(NA, 0, 1, NA)), 
           type    = 'binomial'
           )

summary(fm2)

我认为代码还包括不需要drm的交互。RepType

4

0 回答 0