If some prior weights are zero, then logLik(glm(..., weights=weights)) and logLik(lm(..., weights=weights)) differ. The glm version gives a log likelihood of -Inf and a nobs attribute that includes the zero-weighted cases. The lm version omits the zero-weighted cases before calculating the log likelihood and nobs. Is this expected behavior? Or should people be using subset=weights>0 with glm? > gfit <- glm(y ~ x, data=data.frame(x=1:10,y=sin((1:10)/3)), weights=as.numeric(x>1.5)) > nobs(gfit) [1] 9 > str(unclass(logLik(gfit))) # nobs(gfit) != nobs(logLik(gfit)), logLik is -Inf atomic [1:1] -Inf - attr(*, "nobs")= int 10 - attr(*, "df")= num 3 > lfit <- lm(y ~ x, data=data.frame(x=1:10,y=sin((1:10)/3)), weights=as.numeric(x>1.5)) > nobs(lfit) [1] 9 > str(unclass(logLik(lfit))) # nobs(lfit) == nobs(logLik(lfit)), logLik finite atomic [1:1] -0.471 - attr(*, "nall")= int 9 - attr(*, "nobs")= int 9 - attr(*, "df")= num 3