Fitting Multiple Logistic Regression with Interaction between Quantitative and Qualitative Explanatory Variables with drm function from drc package

六眼飞鱼酱① 提交于 2019-12-13 02:35:59

问题


As a follow up to this question answered by @EDi. I wonder how to fit the following glm model with drc function from drc package.

GLM Code

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 Code

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)

I think drm code also includes the interaction between Rep and Type which is not required.

来源:https://stackoverflow.com/questions/36382349/fitting-multiple-logistic-regression-with-interaction-between-quantitative-and-q

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!