Skip to content

Commit

Permalink
lme 'weights' fix (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
rvlenth committed Aug 30, 2024
1 parent 52c445c commit a39b44b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: emmeans
Type: Package
Title: Estimated Marginal Means, aka Least-Squares Means
Version: 1.10.4
Date: 2024-08-10
Version: 1.10.4.900001
Date: 2024-08-30
Authors@R: c(person("Russell V.", "Lenth", role = c("aut", "cre", "cph"),
email = "russell-lenth@uiowa.edu"),
person("Ben", "Bolker", role = "ctb"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: "NEWS for the emmeans package"
---

## emmeans 1.10.4.90xxxx
* Fix for long-standing `weights` bug in `lme()` (#356)


## emmeans 1.10.4
* Refinements in tracking static offsets
* Made d.f. consistent for `geeglm` and `glmgee` (#496)
Expand Down
2 changes: 1 addition & 1 deletion R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ emm_basis.merMod = function(object, trms, xlev, grid,
#' @export
recover_data.lme = function(object, data, ...) {
fcall = object$call
if (!is.null(eval(fcall$weights))) { # painful -- we only get weights for complete cases
if (!is.null(eval(fcall$weights, environment(terms(object)), parent.frame()))) { # painful -- we only get weights for complete cases
if (!is.null(object$na.action)) {
w = nlme::varWeights(object$modelStruct)
wts = rep(0, length(w) + length(object$na.action))
Expand Down

0 comments on commit a39b44b

Please sign in to comment.