Skip to content

Commit

Permalink
this one?
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 8, 2024
1 parent a56ab10 commit 4ecd1d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/demean.R
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +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)]]
select,
function(i) dat[[i]] - stats::ave(dat[[i]], dat[[by[length(by)]]], FUN = gm_fun)
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 4ecd1d0

Please sign in to comment.