How can I calculate msd of one specific group?

Hi all, I want to get the data of msd of one specific group, I’m not sure that my commands are correct.
Here is commands:
compute MSD A4 msd com yes

A4 is the group that I focus on

fix 2 A4 ave/time 1 100 100 c_MSD[4] file msd_O2.txt

I hope I describe my question clearly for any’s clarification.
Any advice would be appreciated.

for clarification and all details about the functioning of a feature in LAMMPS please consult the manual.