Skip to content

Commit

Permalink
Include variance parameters in the computation of degrees of freedom
Browse files Browse the repository at this point in the history
  • Loading branch information
melff committed Jul 13, 2021
1 parent 27bb793 commit 7f47d53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: mclogit
Type: Package
Title: Multinomial Logit Models, with or without Random Effects or Overdispersion
Version: 0.9.2
Date: 2021-06-03
Version: 0.9.3
Date: 2021-07-13
Author: Martin Elff
Maintainer: Martin Elff <mclogit@elff.eu>
Description: Provides estimators for multinomial logit models in their
Expand Down
8 changes: 5 additions & 3 deletions pkg/R/mmclogit-fitPQLMQL.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,21 @@ Please reconsider your model specification."
info.psi <- fit$info.psi

Phi <- fit$Phi

lambda <- fit$lambda

ntot <- length(y)
pi0 <- mclogitP(offset,s)
null.deviance <- sum(ifelse(y>0,
2*w*y*(log(y)-log(pi0)),
0))
resid.df <- length(y)#-length(unique(s))
model.df <- ncol(X)
resid.df <- length(y) - length(unique(s))
model.df <- ncol(X) + length(lambda)
resid.df <- resid.df - model.df
return(list(
coefficients = coef$fixed,
random.effects = coef$random,
VarCov = Phi,
lambda = lambda,
linear.predictors = eta,
working.residuals = (y-pi)/pi,
response.residuals = y-pi,
Expand Down
3 changes: 3 additions & 0 deletions pkg/inst/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2021-07-13:
- Include variance parameters in the computation of degrees of freedom

2021-06-03:
- Be less zealous about group-level covariates constant in some choice sets.

Expand Down

0 comments on commit 7f47d53

Please sign in to comment.