Tuesday, October 6, 2020

Averaging Across Variable Columns (SPSS)

There may be a more efficient way to perform this function, as simpler functionality exists within other programming languages. However, I have not been able to discover a non “ad-hoc” method for performing this task within SPSS.

We will assume that we are operating within the following data set:


Which possesses the following data labels:


Assuming that all variables are on a similar scale, we could create a new variable by utilizing the code below:

COMPUTE CatSum=MEAN(VarA,
VarB,
VarC).
EXECUTE.

This new variable will be named “CatSum”. This variable will be comprised of the mean of the sum of each variable’s corresponding observational data rows: (“VarA”, “VarB”, “VarC”). 


To generate the mean value of our newly created “CatSum” variable, we would execute the following code:

DESCRIPTIVES VARIABLES=CatSum
/STATISTICS=MEAN STDDEV. 

This produces the output:



To reiterate what we are accomplishing by performing this task, we are simply generating the mean value of the sum of variables: “VarA”, “VarB”, “VarC”.

Another way to conceptually envision this process, is to imagine that we are placing all of the variables together into a single column:


After which, we are generating the mean value of the column which contains all of the combined variable observational values.

And that, is that!

At least, for this article. 

Stay studious in the interim, Data Heads!

- RD

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.