Suppose the following data:
Each variable name has either the suffix _pos, _neut or _neg assigned to it. My goal is to create a table of sums consisting of the three columns "Pos.", "Neut." and "Neg." which I would like to export to word.
Each row should contain the respective sum for each of the three columns.
This screenshot is supposed to illustrate what the ending result should look like:

For example:
Cell B15 contains the sum of the variable n_IM_ER_pos
Cell C15 contains the sum of the variable n_IM_ER_neu
Cell D15 contains the sum of the variable n_IM_ER_neg
I haven't got any further with this issue as I am struggling to create the desired columns from the variable names suffix.
Any help is much appreciated
Thank you
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(n_IM_ER_pos n_IM_ER_neut n_IM_ER_neg n_IM_EG_pos n_IM_EG_neut n_IM_EG_neg) 0 1 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 2 0 3 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 end
Each variable name has either the suffix _pos, _neut or _neg assigned to it. My goal is to create a table of sums consisting of the three columns "Pos.", "Neut." and "Neg." which I would like to export to word.
Each row should contain the respective sum for each of the three columns.
This screenshot is supposed to illustrate what the ending result should look like:
For example:
Cell B15 contains the sum of the variable n_IM_ER_pos
Cell C15 contains the sum of the variable n_IM_ER_neu
Cell D15 contains the sum of the variable n_IM_ER_neg
I haven't got any further with this issue as I am struggling to create the desired columns from the variable names suffix.
Any help is much appreciated
Thank you

Comment