Skip to content

Commit

Permalink
Update NEWS.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stefvanbuuren committed Apr 17, 2024
2 parents 62adb40 + 0cd9f80 commit f1b292b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# mice 3.16.9

* Fixes a problem with the `minpuc` argument in `quickpred()` (#634)
* Fixes `coef() not available on S4 object` when using with `lavaan` (#615, #616)

# mice 3.16.8

Expand Down
4 changes: 2 additions & 2 deletions R/get.df.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ get.dfcom <- function(model, dfcom = NULL) {

# coxph model: nevent - p
if (inherits(model, "coxph")) {
return(as.numeric(max(model$nevent - length(coef(model)), 1)))
return(as.numeric(max(model$nevent - length(stats::coef(model)), 1)))
}

# other model: n - p
nobs <- tryCatch(length(stats::residuals(model)),
error = function(e) NULL)
if (!is.null(nobs)) {
return(as.numeric(max(nobs - length(coef(model)), 1)))
return(as.numeric(max(nobs - length(stats::coef(model)), 1)))
}

# nothing found
Expand Down

0 comments on commit f1b292b

Please sign in to comment.