Login  Register

How to calculate the average for many observations?

Posted by Dimitris Nikolaou on Oct 02, 2006; 7:20pm
URL: http://spssx-discussion.165.s1.nabble.com/How-to-calculate-the-average-for-many-observations-tp1071306.html

Hi to everybody!

I have recently come up with a problem. This is a general example:



age      sex       educ0   educ1   educ2   educ3     lnwage
20      male         1        0           0          0            0
20      male         1        0           0          0          9.65
20      male         1        0           0          0          8.56
20      male         0        1           0          0          7.65
20      male         0        1           0          0            0
20      male         0        0           1          0          8.23
20      male         0        0           1          0          8.15
20      male         0        0           1          0          8.00
20      male         0        0           1          0            0
20      male         0        0           0          1          8.88
20      male         0        0           0          1            0
20      male         0        0           0          1          6.57
20   female         1        0           0          0            0
20   female         1        0           0          0          9.65
20   female         1        0           0          0          8.56
20   female         0        1           0          0          7.65
20   female         0        1           0          0            0
20   female         0        0           1          0          8.23
20   female         0        0           1          0          8.15
20   female         0        0           1          0          8.00
20   female         0        0           1          0            0
20   female         0        0           0          1          8.88
20   female         0        0           0          1            0
20   female         0        0           0          1          6.57


I would like to find a way so as the spss to calculate the average for
eevery team. By this I mean I want to calculate the following:

if (age=20 and sex=male and educ0=1) then calculate (9.65+8.56)/2. The
average only for those who have wages.
if (age=20 and sex=male and educ1=1) then calculate (7.65)/1.
....
....
....
if (age=20 and sex=female and educ3=1) then calculate (8.88+6.57)/2.

And I want to do this for every age from 17 to 65. I tried to calculate it
but with no success. My only alternative is to make the calculations
manually. But I have to do this for about 800.000 observation and for more
than once.So I was wondering if there is a faster way.

Thanks in advance!

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/