diff --git a/pkg/DESCRIPTION b/pkg/DESCRIPTION index 926e51d..f0ee984 100644 --- a/pkg/DESCRIPTION +++ b/pkg/DESCRIPTION @@ -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 Description: Provides estimators for multinomial logit models in their diff --git a/pkg/R/mmclogit-fitPQLMQL.R b/pkg/R/mmclogit-fitPQLMQL.R index 28b0976..865ab4b 100644 --- a/pkg/R/mmclogit-fitPQLMQL.R +++ b/pkg/R/mmclogit-fitPQLMQL.R @@ -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, diff --git a/pkg/inst/ChangeLog b/pkg/inst/ChangeLog index ad8ba77..d3d130a 100755 --- a/pkg/inst/ChangeLog +++ b/pkg/inst/ChangeLog @@ -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.