Skip to content

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 8, 2024
1 parent 3cfc69a commit a56ab10
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/demean.R
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,10 @@ degroup <- function(x,
})
# create de-meaned variables by subtracting the group mean from each individual value
person_means_list <- lapply(
seq_along(select),
function(i) dat[[select[i]]] - group_means_list[[i]][[length(by)]]
# seq_along(select),
# function(i) dat[[select[i]]] - group_means_list[[i]][[length(by)]]
select,
function(i) dat[[i]] - stats::ave(dat[[i]], dat[[by[length(by)]]], FUN = gm_fun)
)
} else {
# cross-classified design: by > 1
Expand Down

0 comments on commit a56ab10

Please sign in to comment.