STATA commad "by V1: egen newvar=count(V1)": how to do it in SPSS?


New Member
Hello to all. On STATA the command by V1: egen V2 = count (V1) generates a new variable that contains the frequency of the different values of V1. To show you the result I'm attaching two images:

Img 1: frequency table of V1

Img 2: Stata command and results

What command should I use in SPSS to get the same result?
Thanks everyone for the help.