Rize S. answered 03/23/23
Master's in MISM, 25 yrs Exp: SPSS Expert
Yes, it is possible to create a new variable in SPSS that reports the mean value from a range. You can use the following steps:
- Open your dataset in SPSS and go to Transform -> Compute Variable.
- In the Compute Variable dialog box, give a name for the new variable in the Target Variable box.
- In the Numeric Expression box, use the following formula:
MEAN(range_variable, ".", "-")
- Replace "range_variable" with the name of the variable that contains the range values. The second argument "." specifies that the range values are separated by a dot (".") and the third argument "-" specifies that the range values are separated by a hyphen ("-"). If your range values are separated by other characters, you can replace "." and "-" accordingly.
- Click on OK to create the new variable.
- SPSS will create a new variable with the mean value of the range. If the range is "25-30", for example, the new variable will have a value of 27.5.
Note that if the range values contain missing values, the new variable will also contain missing values. You can also use the MEAN function with the same arguments in a syntax file for automation.