aggregate outfile (sum two columns)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

aggregate outfile (sum two columns)

Keval Khichadia
Hi,
 
What is the syntax for using the aggregate outfile procedure to sum two different columns and is it even possible to do this . I have (below) but it is not working:
 

 

aggregate outfile = * mode = addvariables overwrite = yes

/ break = id

/ TotalAidGiven = sum(Disburs_Amt, Other_Amount).

 

 

Thanks,

 

Keval


Reply | Threaded
Open this post in threaded view
|

Re: aggregate outfile (sum two columns)

Oliver, Richard
Aggregate combines cases (rows), not variables (columns). If you want to compute a new variable that is the sum of two variables:
 
compute var3=sum(var1, var2).
 
If you still need/want to aggregate the end result, use the AGGREGATE SUM function on the computed variable.


From: SPSSX(r) Discussion on behalf of Keval Khichadia
Sent: Mon 4/27/2009 7:37 PM
To: [hidden email]
Subject: aggregate outfile (sum two columns)

Hi,
 
What is the syntax for using the aggregate outfile procedure to sum two different columns and is it even possible to do this . I have (below) but it is not working:
 

 

aggregate outfile = * mode = addvariables overwrite = yes

/ break = id

/ TotalAidGiven = sum(Disburs_Amt, Other_Amount).

 

 

Thanks,

 

Keval