creating grouped mean variable

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
srk80
Posts: 7
Joined: Sat Mar 18, 2023 7:37 am

creating grouped mean variable

Post by srk80 »

Hi,

I would like to have a functionality similar to ave in base R to create a grouped mean variable. I have a dataset with a continuous variable x and group. Now I want to create a new variable where all observations in a particular group have the same mean. How to do?
User avatar
jonathon
Posts: 2886
Joined: Fri Jan 27, 2017 10:04 am

Re: creating grouped mean variable

Post by jonathon »

you can achieve this with computer/transformed variables:

x - VMEAN(x, group_by=group)

jonathon
Post Reply