Discussion:
using Compare Means procedure in spss
(too old to reply)
d***@hotmail.com
2005-09-14 02:55:18 UTC
Permalink
Dear Group,

I am trying to use the Compare Means procedure in SPSS to calculate the
geometric means for a variable with 3 categories A, B and C. I know how
to calculate geometric means using the logarithm of the original
variable by hand (thankyou, Rich). The following is a sample data set.
I want to calculate a geometric mean and SD for each group A, B and C.

These values are logarithms of the original variables.

Group A B C
-2.34 -1.58 -1.32
-2.37 -1.34 -1.24
1.23 2.64 3.52

Group Mean SD
A -1.16 2.07
B -0.09 2.37
C 0.32 2.77

My logaritms have negative values and if I try to get Means--> Compare
Means in SPSS to run this data, the program responds with 'The data
contains negative values' and returns no result. How do I go about
calculating my group means using SPSS? Also, there appears to be no
geometric SD option in SPSS. Is this right?

Thankyou in advance,
Beth
Bruce Weaver
2005-09-14 11:35:04 UTC
Permalink
Post by d***@hotmail.com
Dear Group,
I am trying to use the Compare Means procedure in SPSS to calculate the
geometric means for a variable with 3 categories A, B and C. I know how
to calculate geometric means using the logarithm of the original
variable by hand (thankyou, Rich). The following is a sample data set.
I want to calculate a geometric mean and SD for each group A, B and C.
These values are logarithms of the original variables.
Group A B C
-2.34 -1.58 -1.32
-2.37 -1.34 -1.24
1.23 2.64 3.52
Group Mean SD
A -1.16 2.07
B -0.09 2.37
C 0.32 2.77
My logaritms have negative values and if I try to get Means--> Compare
Means in SPSS to run this data, the program responds with 'The data
contains negative values' and returns no result.
You must be trying to calculate a geometric mean on the data shown
above. But those data are log-transformed. You should be using the
/CELLS = GEOMETRIC option of the MEANS procedure on the raw data.
Assuming you used the natural log to transform your data, here are your
original scores (in the X column):

group logx x

1 -2.34 .10
2 -1.58 .21
3 -1.32 .27
1 -2.37 .09
2 -1.34 .26
3 -1.24 .29
1 1.23 3.42
2 2.64 14.01
3 3.52 33.78

All of the numbers are positive, and the following command will work:

MEANS x by group /cells = geometric .

It produces this output:

Report
Geometric Mean
|-----|------|
|group|x |
|-----|------|
|1 |.3135 |
|-----|------|
|2 |.9109 |
|-----|------|
|3 |1.3771|
|-----|------|
|Total|.7326 |
|-----|------|
Post by d***@hotmail.com
How do I go about
calculating my group means using SPSS?
See above.

Also, there appears to be no
Post by d***@hotmail.com
geometric SD option in SPSS. Is this right?
The SD of the log-transformed data is meaningful (as long as you are
working with the log-transformed data); but exponentiating it to get
back to original units makes no sense.

Here's a little exercise to demonstrate that you can obtain the same
geometric group means as shown above, but doing the calculations "by
hand", so to speak.


* ---------------------------------------- .
data list list / group (f1.0) logx (f5.2).
begin data.
1 -2.34
2 -1.58
3 -1.32
1 -2.37
2 -1.34
3 -1.24
1 1.23
2 2.64
3 3.52
end data.

means logx by group.

* This duplicates the means shown by the OP .
* Now compute the original (raw) scores,
* assuming natural log was used to transform them.
* Then calculate the geometric means.

compute x = exp(logx).
list.
means x by group /cells = geometric.

* Now compute the same geometric group means "by hand" .
* First, get group means for variable LOGX .

aggregate
/break = group
/meanlogx = mean(logx).

* Exponentiate group means of LOGX to get geometric means.

compute gmeanx = exp(meanlogx).
var lab
gmeanx 'Geometric mean of X'.
means gmeanx by group / cells = mean.

* Geometric group means match what we found above.
* The overall mean does not, because we would have
* to aggregate over all cases to calculate it.

* ---------------------------------------- .
--
Bruce Weaver
***@lakeheadu.ca
www.angelfire.com/wv/bwhomedir
Continue reading on narkive:
Loading...